diff --git a/QXLive/Dynamic(语圈)/View/QXExpansionCell.m b/QXLive/Dynamic(语圈)/View/QXExpansionCell.m index 3bc422e..7808c04 100644 --- a/QXLive/Dynamic(语圈)/View/QXExpansionCell.m +++ b/QXLive/Dynamic(语圈)/View/QXExpansionCell.m @@ -130,20 +130,12 @@ self.nameLabel.shimmerColor = [UIColor colorWithHexString:self.model.nickname_color]; [self.nameLabel startShimmer]; } -// else{ -// self.nameLabel.shimmerColor = [UIColor clearColor]; -// [self.nameLabel stopShimmer]; -// } } -(void)nameStopAnimate{ if ([self.model.nickname_color isExist]) { self.nameLabel.shimmerColor = [UIColor colorWithHexString:self.model.nickname_color]; [self.nameLabel stopShimmer]; } -// else{ -// self.nameLabel.shimmerColor = [UIColor clearColor]; -// [self.nameLabel stopShimmer]; -// } } -(void)previewPhotoWithCurrentIndex:(NSInteger)currentIndex{ diff --git a/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m b/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m index d77eb40..683ca08 100644 --- a/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m +++ b/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m @@ -53,7 +53,7 @@ @property (nonatomic,strong)UIButton *skyDownBtn; @property (nonatomic,strong)QXNewPeoplePopView *nPeopleRechargeView; -@property (nonatomic,strong)QXAppstoreHomeView *appStoreView; +//@property (nonatomic,strong)QXAppstoreHomeView *appStoreView; @property (nonatomic,strong)SDCycleScrollView *rechargePermissionView; @property (nonatomic,strong)NSMutableArray *rechargePermissionArray; @@ -139,8 +139,8 @@ // }]; [self getBanner]; // [self getRechargePermission]; - self.appStoreView.hidden = YES; - [self.view addSubview:self.appStoreView]; +// self.appStoreView.hidden = YES; +// [self.view addSubview:self.appStoreView]; self.rechargePermissionView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(SCREEN_WIDTH-80-17, SCREEN_HEIGHT-(TabbarContentHeight+90+80), 80, 80) delegate:self placeholderImage:nil]; self.rechargePermissionView.pageControlBottomOffset = -15; @@ -402,11 +402,11 @@ @strongify(self) [self.dataArray removeAllObjects]; [self.dataArray addObjectsFromArray:list]; - if (isAppStore) { - self.appStoreView.hidden = NO; - }else{ - self.appStoreView.hidden = YES; - } +// if (isAppStore) { +// self.appStoreView.hidden = NO; +// }else{ +// self.appStoreView.hidden = YES; +// } // weakSelf.appStoreView.dataArray = list; self.topView.dataArray = list; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { @@ -424,7 +424,7 @@ } [self.bannerArry removeAllObjects]; [self.bannerArry addObjectsFromArray:list]; - self.appStoreView.bannerArray = list; +// self.appStoreView.bannerArray = list; self.bannerScrollView.imageURLStringsGroup = arr; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { @@ -671,12 +671,12 @@ return _rechargePermissionArray; } --(QXAppstoreHomeView *)appStoreView{ - if (!_appStoreView) { - _appStoreView = [[QXAppstoreHomeView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-TabbarContentHeight)]; - } - return _appStoreView; -} +//-(QXAppstoreHomeView *)appStoreView{ +// if (!_appStoreView) { +// _appStoreView = [[QXAppstoreHomeView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-TabbarContentHeight)]; +// } +// return _appStoreView; +//} -(void)dealloc{ [[NSNotificationCenter defaultCenter] removeObserver:self]; } diff --git a/QXLive/HomePage(声播)/Model/QXRoomBestFriendModel.h b/QXLive/HomePage(声播)/Model/QXRoomBestFriendModel.h index 5ef86a3..7aa04dc 100644 --- a/QXLive/HomePage(声播)/Model/QXRoomBestFriendModel.h +++ b/QXLive/HomePage(声播)/Model/QXRoomBestFriendModel.h @@ -19,4 +19,8 @@ NS_ASSUME_NONNULL_BEGIN @end + +@interface QXHeartBeatSpaceListModel : NSObject + +@end NS_ASSUME_NONNULL_END diff --git a/QXLive/HomePage(声播)/Model/QXRoomBestFriendModel.m b/QXLive/HomePage(声播)/Model/QXRoomBestFriendModel.m index e581daf..4ad6e33 100644 --- a/QXLive/HomePage(声播)/Model/QXRoomBestFriendModel.m +++ b/QXLive/HomePage(声播)/Model/QXRoomBestFriendModel.m @@ -23,6 +23,7 @@ } @end +@implementation QXHeartBeatSpaceListModel - +@end diff --git a/QXLive/Login(登录)/Controlller/QXLoginViewController.m b/QXLive/Login(登录)/Controlller/QXLoginViewController.m index 71e7ed1..df15c37 100644 --- a/QXLive/Login(登录)/Controlller/QXLoginViewController.m +++ b/QXLive/Login(登录)/Controlller/QXLoginViewController.m @@ -530,11 +530,12 @@ showToast(QXText(@"请输入正确的手机号码")); return; } + sender.userInteractionEnabled = NO; MJWeakSelf [QXLoginNetwork getSmscodeWithMobile:self.accountTextField.textField.text type:GetSmscodeTypeLogin successBlock:^(id _Nonnull responseObject) { [weakSelf.codeTextField startTimeDown]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - + sender.userInteractionEnabled = YES; }]; } diff --git a/QXLive/Login(登录)/View/QXLoginTextField.m b/QXLive/Login(登录)/View/QXLoginTextField.m index c965ddc..7ba858f 100644 --- a/QXLive/Login(登录)/View/QXLoginTextField.m +++ b/QXLive/Login(登录)/View/QXLoginTextField.m @@ -260,6 +260,9 @@ __block int timeCount = 60; _timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{ timeCount--; + if (self == nil) { + return; + } if (timeCount<=0) { [self->_timer invalidate]; self->_codeBtn.userInteractionEnabled = YES; @@ -269,4 +272,10 @@ } }]; } +-(void)dealloc{ + if (_timer) { + [_timer invalidate]; + _timer = nil; + } +} @end diff --git a/QXLive/Manager/QXRoomMessageManager.h b/QXLive/Manager/QXRoomMessageManager.h index bcb7c8e..e81093b 100644 --- a/QXLive/Manager/QXRoomMessageManager.h +++ b/QXLive/Manager/QXRoomMessageManager.h @@ -145,6 +145,19 @@ typedef NS_ENUM(NSInteger) { QXRoomMessageTypeSingerRoomNextSongDidChanged = 1071, /// 歌曲数量发生变化 QXRoomMessageTypeSingerRoomSongCountDidChanged = 1072, + + /// CP 特效 + QXRoomMessageTypeCpJoinRoom = 1080, + + + /// 开始签约 + QXRoomMessageTypeStartSign = 1090, + /// 结束签约 + QXRoomMessageTypeEndSign = 1092, + /// 签约延时 + QXRoomMessageTypeDelaySignTime = 1093, + /// 身价发生变化 + QXRoomMessageTypeSignBodyPriceDidChanged = 1091, }QXRoomMessageType; NS_ASSUME_NONNULL_BEGIN @protocol QXRoomMessageManagerDelegate @@ -290,6 +303,16 @@ NS_ASSUME_NONNULL_BEGIN /// 已点歌曲数量发生变化 -(void)singerSongCountDidChanged:(NSString*)count; + +/// 签约开始 +-(void)signDidStartWithEndTime:(NSString *)endTime signId:(NSString *)signId signDay:(NSString*)signDay signValue:(NSString*)signValue; +/// 签约结束 +-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value; +/// 签约身价变化 +-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId; +/// 签约身价变化 +-(void)signTimeDelayWithEndTime:(NSString*)endTime; + @end @interface QXRoomMessageManager : NSObject @property (nonatomic,weak)iddelegate; diff --git a/QXLive/Manager/QXRoomMessageManager.m b/QXLive/Manager/QXRoomMessageManager.m index 1f4eb42..681bf0c 100644 --- a/QXLive/Manager/QXRoomMessageManager.m +++ b/QXLive/Manager/QXRoomMessageManager.m @@ -14,6 +14,7 @@ #import "TUIChatConfig.h" #import "QXDrifNobilityJoinRoomView.h" #import "QXCustomAlertView.h" +#import "QXHeartBeatSpaceViewController.h" @interface QXRoomMessageManager() @property (nonatomic,strong)NSString *groupId; @@ -677,6 +678,46 @@ } } break; + case QXRoomMessageTypeCpJoinRoom:{ + QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text]; + [[QXGiftPlayerManager shareManager] displayCpEffectView:model]; + } + break; + case QXRoomMessageTypeStartSign:{ + NSString *sign_id = [NSString stringWithFormat:@"%@",msg.Text[@"sign_id"]]; + NSString *end_time = [NSString stringWithFormat:@"%@",msg.Text[@"end_time"]]; + NSString *sign_day = [NSString stringWithFormat:@"%@",msg.Text[@"sign_day"]]; + NSString *current_body_value = [NSString stringWithFormat:@"%@",msg.Text[@"current_body_value"]]; + if (self.delegate && [self.delegate respondsToSelector:@selector(signDidStartWithEndTime:signId:signDay:signValue:)]) { + [self.delegate signDidStartWithEndTime:end_time signId:sign_id signDay:sign_day signValue:current_body_value]; + } + } + break; + case QXRoomMessageTypeEndSign:{ + QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text]; + NSString *sign_value = [NSString stringWithFormat:@"%@",msg.Text[@"sign_value"]]; + if (self.delegate && [self.delegate respondsToSelector:@selector(signDidEndWithUserInfo1:userInfo2:sign_value:)]) { + [self.delegate signDidEndWithUserInfo1:model.FromUserInfo userInfo2:model.ToUserInfo sign_value:sign_value]; + } + } + break; + case QXRoomMessageTypeDelaySignTime:{ + NSString *end_time = [NSString stringWithFormat:@"%@",msg.Text[@"end_time"]]; + if (self.delegate && [self.delegate respondsToSelector:@selector(signTimeDelayWithEndTime:)]) { + [self.delegate signTimeDelayWithEndTime:end_time]; + } + } + break; + case QXRoomMessageTypeSignBodyPriceDidChanged:{ + QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text]; + NSString *sign_id = [NSString stringWithFormat:@"%@",msg.Text[@"sign_id"]]; + NSString *sign_value = [NSString stringWithFormat:@"%@",msg.Text[@"sign_value"]]; + if (self.delegate && [self.delegate respondsToSelector:@selector(signValueDidChangedWithSignUserInfo:sign_value:signId:)]) { + [self.delegate signValueDidChangedWithSignUserInfo:model.FromUserInfo sign_value:sign_value signId:sign_id]; + } + } + break; + default: break; } @@ -730,6 +771,10 @@ alertView.commitBlock = ^{ QXLOG(@"进入心动空间"); + QXHeartBeatSpaceViewController *vc = [[QXHeartBeatSpaceViewController alloc] init]; + QXRoomNavigationController *navagationController = (QXRoomNavigationController*)KEYWINDOW.rootViewController; + vc.userId = QXGlobal.shareGlobal.loginModel.user_id; + [navagationController pushViewController:vc animated:YES]; }; } diff --git a/QXLive/Message(音信)/Controller/QXSystemNoticeViewController.m b/QXLive/Message(音信)/Controller/QXSystemNoticeViewController.m index bbc7ead..2d0ca6e 100644 --- a/QXLive/Message(音信)/Controller/QXSystemNoticeViewController.m +++ b/QXLive/Message(音信)/Controller/QXSystemNoticeViewController.m @@ -8,9 +8,10 @@ #import "QXSystemNoticeViewController.h" #import "QXSystemNoticeCell.h" #import "QXSystemMessageCell.h" +#import "QXSystemMessageHandleCell.h" #import "QXMessageServices.h" #import "AppDelegate.h" -@interface QXSystemNoticeViewController () +@interface QXSystemNoticeViewController () @property (nonatomic,strong)UITableView *tableView; @property (nonatomic,assign)CGFloat rowHeight; @end @@ -78,12 +79,22 @@ cell.model = self.dataArray[indexPath.row]; return cell; }else{ - QXSystemMessageCell *cell = [QXSystemMessageCell cellWithTableView:tableView]; - cell.model = self.dataArray[indexPath.row]; - return cell; + QXMessageListModel *model = self.dataArray[indexPath.row]; + if (model.type.intValue == 6) { + QXSystemMessageHandleCell *cell = [QXSystemMessageHandleCell cellWithTableView:tableView]; + cell.model = model; + cell.delegate = self; + return cell; + }else{ + QXSystemMessageCell *cell = [QXSystemMessageCell cellWithTableView:tableView]; + cell.model = model; + return cell; + } + } } + -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ QXMessageListModel *model = self.dataArray[indexPath.row]; if (model.room_id.integerValue > 0) { @@ -97,13 +108,22 @@ } } +-(void)handleInviteIsAgree:(BOOL)isAgree message:(nonnull QXMessageListModel *)message{ + MJWeakSelf + [QXMessageServices guildInviteApplyHandleWithApplyId:message.id type:isAgree?@"1":@"2" successBlock:^(NSDictionary * _Nonnull dict) { + showToast(@"操作成功"); + weakSelf.page = 1; + [weakSelf getMessageList]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} -(UITableView *)tableView{ if (!_tableView) { _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStylePlain)]; _tableView.dataSource = self; _tableView.delegate = self; _tableView.backgroundColor = [UIColor clearColor]; - _tableView.rowHeight = 60; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; _tableView.rowHeight = UITableViewAutomaticDimension; _tableView.estimatedRowHeight = self.rowHeight; diff --git a/QXLive/Message(音信)/Model/QXMessageModel.h b/QXLive/Message(音信)/Model/QXMessageModel.h index d39fb68..da06ad1 100644 --- a/QXLive/Message(音信)/Model/QXMessageModel.h +++ b/QXLive/Message(音信)/Model/QXMessageModel.h @@ -40,6 +40,8 @@ NS_ASSUME_NONNULL_BEGIN @property (strong,nonatomic)NSString *image; @property (strong,nonatomic)NSString *url; +/// 公会邀请处理状态 0未处理 1已通过 2已拒绝 +@property (strong,nonatomic)NSString *guild_invited_status; @property (strong,nonatomic)NSString *room_id; @end diff --git a/QXLive/Message(音信)/Services/QXMessageServices.h b/QXLive/Message(音信)/Services/QXMessageServices.h index 5f7a42c..90623ab 100644 --- a/QXLive/Message(音信)/Services/QXMessageServices.h +++ b/QXLive/Message(音信)/Services/QXMessageServices.h @@ -31,6 +31,13 @@ NS_ASSUME_NONNULL_BEGIN +(void)getMessageWithId:(NSString*)Id successBlock:(void (^)(QXMessageListModel *model))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock; +/** + 消息工会邀请处理 + */ ++(void)guildInviteApplyHandleWithApplyId:(NSString*)applyId + type:(NSString*)type + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Message(音信)/Services/QXMessageServices.m b/QXLive/Message(音信)/Services/QXMessageServices.m index a694d41..6a694cf 100644 --- a/QXLive/Message(音信)/Services/QXMessageServices.m +++ b/QXLive/Message(音信)/Services/QXMessageServices.m @@ -48,4 +48,24 @@ failBlock(error,msg); }]; } + +/** + 消息工会邀请处理 + */ ++(void)guildInviteApplyHandleWithApplyId:(NSString*)applyId + type:(NSString*)type + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"apply_id":applyId?:@"", + @"type":type?type:@"" + }; + [[QXRequset shareInstance] postWithUrl:QXGuildInviteApplyHandle parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} @end diff --git a/QXLive/Message(音信)/View/QXSystemMessageHandleCell.h b/QXLive/Message(音信)/View/QXSystemMessageHandleCell.h new file mode 100644 index 0000000..543cf4a --- /dev/null +++ b/QXLive/Message(音信)/View/QXSystemMessageHandleCell.h @@ -0,0 +1,32 @@ +// +// QXSystemMessageHandleCell.h +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import +#import "QXMessageModel.h" +NS_ASSUME_NONNULL_BEGIN +@protocol QXSystemMessageHandleCellDelegate + +@optional +-(void)handleInviteIsAgree:(BOOL)isAgree message:(QXMessageListModel*)message; + +@end + +@interface QXSystemMessageHandleCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *titleLabel; +@property (weak, nonatomic) IBOutlet UIButton *cancelBtn; +@property (weak, nonatomic) IBOutlet UIButton *commitBtn; +@property (weak, nonatomic) IBOutlet UILabel *timeLabel; +@property (weak, nonatomic) IBOutlet UIButton *stateBtn; + +@property (weak, nonatomic) IBOutlet UILabel *contentLabel; + +@property (weak, nonatomic) id delegate; +@property (nonatomic,strong)QXMessageListModel *model; ++(instancetype)cellWithTableView:(UITableView *)tableView; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Message(音信)/View/QXSystemMessageHandleCell.m b/QXLive/Message(音信)/View/QXSystemMessageHandleCell.m new file mode 100644 index 0000000..acd2e9b --- /dev/null +++ b/QXLive/Message(音信)/View/QXSystemMessageHandleCell.m @@ -0,0 +1,66 @@ +// +// QXSystemMessageHandleCell.m +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import "QXSystemMessageHandleCell.h" + +@implementation QXSystemMessageHandleCell ++(instancetype)cellWithTableView:(UITableView *)tableView{ + static NSString *cellId = @"QXSystemMessageHandleCell"; + QXSystemMessageHandleCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; + if (!cell) { + cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject; + cell.backgroundColor = [UIColor clearColor]; + } + return cell; +} + +-(void)setModel:(QXMessageListModel *)model{ + _model = model; + self.contentLabel.text = model.content; + NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000 + NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; + formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; + NSString*time = [formatter stringFromDate:date]; + self.timeLabel.text = time; + if (model.guild_invited_status.intValue == 0) { + self.cancelBtn.hidden = NO; + self.commitBtn.hidden = NO; + self.stateBtn.hidden = YES; + }else if (model.guild_invited_status.intValue == 1){ + self.cancelBtn.hidden = YES; + self.commitBtn.hidden = YES; + self.stateBtn.hidden = NO; + self.stateBtn.selected = NO; + }else if (model.guild_invited_status.intValue == 2){ + self.cancelBtn.hidden = YES; + self.commitBtn.hidden = YES; + self.stateBtn.hidden = NO; + self.stateBtn.selected = YES; + } +} +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} +- (IBAction)cancelAction:(id)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(handleInviteIsAgree:message:)]) { + [self.delegate handleInviteIsAgree:NO message:self.model]; + } +} +- (IBAction)commitAction:(id)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(handleInviteIsAgree:message:)]) { + [self.delegate handleInviteIsAgree:YES message:self.model]; + } +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/QXLive/Message(音信)/View/QXSystemMessageHandleCell.xib b/QXLive/Message(音信)/View/QXSystemMessageHandleCell.xib new file mode 100644 index 0000000..a15562d --- /dev/null +++ b/QXLive/Message(音信)/View/QXSystemMessageHandleCell.xib @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QXLive/Mine(音域)/Controller/QXMineViewController.m b/QXLive/Mine(音域)/Controller/QXMineViewController.m index 01367e8..1b26866 100644 --- a/QXLive/Mine(音域)/Controller/QXMineViewController.m +++ b/QXLive/Mine(音域)/Controller/QXMineViewController.m @@ -36,6 +36,8 @@ #import "QXRoomSingerAuthViewController.h" #import "QXMineSongListViewController.h" #import "QXIntimateViewController.h" +#import "QXBodyPriceRuleView.h" +#import "QXFamilyViewController.h" #import @interface QXMineViewController () @@ -127,6 +129,12 @@ [self gotoSetting]; } break; + case QXMineServiceTypeFamily:{ + QXLOG(@"跳转家族"); + QXFamilyViewController *vc = [[QXFamilyViewController alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; + } + break; case QXMineServiceTypeHelp:{ [self gotoService]; } @@ -223,6 +231,10 @@ [self.navigationController pushViewController:vc animated:YES]; } break; + case QXMainHeaderOptionTypeBodyPrice:{ + [QXBodyPriceRuleView showInView:self.view]; + } + break; case QXMainHeaderOptionTypeWallet:{ QXLOG(@"跳转钱包"); BOOL result = [[NSUserDefaults standardUserDefaults] boolForKey:kWalletRuleHide]; @@ -304,7 +316,7 @@ } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.row == 0) { - return ScaleWidth(110); + return ScaleWidth(168); }else{ // if (QXGlobal.shareGlobal.isOpenRecharge) { return ScaleWidth(168); diff --git a/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m b/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m index 4eeb236..3c3538e 100644 --- a/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m +++ b/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m @@ -41,6 +41,7 @@ -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:NO animated:YES]; + [self.headerView headerStartPlay]; } -(void)setNavgationItems{ [super setNavgationItems]; @@ -91,7 +92,9 @@ _pagingView.mainTableView.backgroundColor = [UIColor clearColor]; self.pagingView.backgroundColor = [UIColor clearColor]; [self.view addSubview:self.pagingView]; - + self.cycleScrollView.hidden = YES; + self.backgourdImageView.hidden = YES; + self.categoryView.hidden = YES; self.categoryView.listContainer = (id)self.pagingView.listContainerView; // self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0); @@ -120,6 +123,9 @@ weakSelf.headerView.height = 243+ScaleWidth(40)+8; } [weakSelf.pagingView resizeTableHeaderViewHeightWithAnimatable:NO duration:0.1 curve:UIViewAnimationCurveLinear]; + weakSelf.cycleScrollView.hidden = NO; + weakSelf.backgourdImageView.hidden = NO; + weakSelf.categoryView.hidden = NO; NSArray *imgs; if (userModel.home_bgimages.length > 0) { imgs = [userModel.home_bgimages componentsSeparatedByString:@","]; @@ -138,7 +144,7 @@ weakSelf.cycleScrollView.imageURLStringsGroup = imgs; } } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - + showToast(msg); }]; } #pragma mark - JXPagingViewDelegate diff --git a/QXLive/Mine(音域)/Controller/个性装扮/QXDressSubViewController.m b/QXLive/Mine(音域)/Controller/个性装扮/QXDressSubViewController.m index 8b3f91f..cfb7d91 100644 --- a/QXLive/Mine(音域)/Controller/个性装扮/QXDressSubViewController.m +++ b/QXLive/Mine(音域)/Controller/个性装扮/QXDressSubViewController.m @@ -10,6 +10,7 @@ #import "QXMineNetwork.h" #import "QXSeatHeaderView.h" #import "QXGiftPlayerManager.h" +#import "QXCustomAlertView.h" @interface QXDressSubViewController () @property (nonatomic,strong)QXSeatHeaderView *headerImageView; @@ -46,17 +47,20 @@ } -(void)getData{ - MJWeakSelf + @weakify(self) [QXMineNetwork userDressListWithType:self.model.id successBlock:^(NSArray * _Nonnull list) { - [weakSelf.dataArray removeAllObjects]; - [weakSelf.dataArray addObjectsFromArray:list]; - if (list.count > 0 ) { - QXUserDressModel *model = [[QXUserDressModel alloc] init]; - model.title = QXText(@"无"); - model.udid = @"-1"; - [weakSelf.dataArray insertObject:model atIndex:0]; + @strongify(self); + [self.dataArray removeAllObjects]; + [self.dataArray addObjectsFromArray:list]; + if (![self.model.id isEqualToString:@"12"]) { + if (list.count > 0 ) { + QXUserDressModel *model = [[QXUserDressModel alloc] init]; + model.title = QXText(@"无"); + model.udid = @"-1"; + [self.dataArray insertObject:model atIndex:0]; + } } - [weakSelf.collectionView reloadData]; + [self.collectionView reloadData]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { }]; @@ -76,8 +80,8 @@ return cell; } -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ - int width = (SCREEN_WIDTH-15*2-22*2-1)/3; - return CGSizeMake(width, width/100*120); + int width = (SCREEN_WIDTH-16*2-15*2-1)/3; + return CGSizeMake((int)width, ScaleWidth(136)); } -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.row == self.selectedIndex) { @@ -96,23 +100,45 @@ } -(void)commitAction{ + if (self.selectedIndex == -1) { + return; + } QXUserDressModel *model = self.dataArray[self.selectedIndex]; + if ([self.model.id isEqualToString:@"12"]) { + @weakify(self); + QXCustomAlertView *al = [[QXCustomAlertView alloc] init]; + [al showInView:self.view title:@"温馨提示" message:[NSString stringWithFormat:@"亲爱的羽声用户,您好~ 您是否确认使用%@,本次使用后 您的身价会降至原身价的%@%%",model.title,model.ext_value] cancleTitle:@"取消" commitTitle:@"确认"]; + al.commitBlock = ^{ + @strongify(self); + [self commitNetworkWithModel:model]; + }; + return; + } + + [self commitNetworkWithModel:model]; +} + +-(void)commitNetworkWithModel:(QXUserDressModel*)model{ BOOL isCancel = NO; if ([model.udid isEqualToString:@"-1"]) { isCancel = YES; }else{ isCancel = NO; } - MJWeakSelf + @weakify(self); [QXMineNetwork setUserDressIsCancel:isCancel udid:model.udid type:self.model.id successBlock:^(NSDictionary * _Nonnull dict) { - if (weakSelf.model.id.intValue == 1) { + @strongify(self); + if (self.model.id.intValue == 1) { [QXGlobal shareGlobal].loginModel.dress = model.play_image; } - if (weakSelf.model.id.intValue == 9) { + if (self.model.id.intValue == 9) { [QXGlobal shareGlobal].loginModel.chat_bubble = model.base_image; } [[QXGlobal shareGlobal] updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel]; showToast(@"设置成功"); + if (self.model.id.intValue == 12) { + [self getData]; + } } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { showToast(msg); }]; @@ -135,9 +161,9 @@ -(UICollectionView *)collectionView{ if (!_collectionView) { UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; - layout.minimumLineSpacing = 22; - layout.minimumInteritemSpacing = 22; - layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15); + layout.minimumLineSpacing = 15; + layout.minimumInteritemSpacing = 15; + layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16); _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.headerImageView.bottom+12+12, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) collectionViewLayout:layout]; _collectionView.delegate = self; _collectionView.dataSource = self; diff --git a/QXLive/Mine(音域)/Controller/亲密关系/QXHeartBeatSpaceViewController.m b/QXLive/Mine(音域)/Controller/亲密关系/QXHeartBeatSpaceViewController.m index b368621..e8370f9 100644 --- a/QXLive/Mine(音域)/Controller/亲密关系/QXHeartBeatSpaceViewController.m +++ b/QXLive/Mine(音域)/Controller/亲密关系/QXHeartBeatSpaceViewController.m @@ -6,17 +6,240 @@ // #import "QXHeartBeatSpaceViewController.h" +#import "QXMineNetwork.h" +#import "QXHeartBeatSpaceRecordCell.h" +#import "QXHeartBeatLevelRuleView.h" +#import "QXUserCpDressView.h" + +@interface QXHeartBeatSpaceViewController () +@property (nonatomic,strong)UIImageView *topImageView; +@property (nonatomic,strong)UIImageView *titleImageView; +@property (nonatomic,strong)UIImageView *flyImageView; +@property (nonatomic,strong)QXSeatHeaderView *leftHeaderView; +@property (nonatomic,strong)UIImageView *heartImageView; +@property (nonatomic,strong)QXSeatHeaderView *rightHeaderView; +@property (nonatomic,strong)UILabel *timeLabel; + +@property (nonatomic,strong)UIView *recordContentView; +@property (nonatomic,strong)UIView *expView; +@property (nonatomic,strong)UILabel *expLabel; +@property (nonatomic,strong)UITableView *tableView; +@property (nonatomic,strong)UIImageView *cpDressBgImageView; +@property (nonatomic,strong)QXUserCpDressView *cpDressView; -@interface QXHeartBeatSpaceViewController () @end @implementation QXHeartBeatSpaceViewController - (void)viewDidLoad { + self.isNoChangeBgImage = YES; [super viewDidLoad]; // Do any additional setup after loading the view. } +-(void)viewWillAppear:(BOOL)animated{ + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:NO animated:YES]; +} +-(void)setNavgationItems{ + [super setNavgationItems]; + UIButton*recordBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; + [recordBtn setImage:[UIImage imageNamed:@"nobility_help_icon"] forState:(UIControlStateNormal)]; + recordBtn.titleLabel.font = [UIFont systemFontOfSize:16]; + [recordBtn addTarget:self action:@selector(helpAction) forControlEvents:(UIControlEventTouchUpInside)]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:recordBtn]; +} +- (void)initSubViews{ + [self updateBackImage:[UIImage imageNamed:@"mine_intimate_back"]]; + self.page = 1; + self.view.backgroundColor = RGB16(0xBF8BFA); + self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_heart_beat_space_bg"]]; + self.topImageView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(336)); + [self.view addSubview:self.topImageView]; + + + + + self.titleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_heart_beat_title"]]; + self.titleImageView.frame = CGRectMake((SCREEN_WIDTH-ScaleWidth(199))/2, ScaleWidth(48), ScaleWidth(199), ScaleWidth(87)); + [self.view addSubview:self.titleImageView]; + + self.flyImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_heart_beat_fly"]]; + self.flyImageView.frame = CGRectMake((self.view.width-ScaleWidth(328))/2, self.titleImageView.top+ScaleWidth(24), ScaleWidth(328), ScaleWidth(184)); + [self.view addSubview:self.flyImageView]; + + self.leftHeaderView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2-ScaleWidth(72), self.titleImageView.bottom+ScaleWidth(26), ScaleWidth(72), ScaleWidth(72))]; + [self.leftHeaderView addRoundedCornersWithRadius:ScaleWidth(36)]; + self.leftHeaderView.layer.borderWidth = 2; + self.leftHeaderView.layer.borderColor = RGB16(0xffffff).CGColor; + [self.view addSubview:self.leftHeaderView]; + + + self.rightHeaderView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake(self.leftHeaderView.right, self.titleImageView.bottom+ScaleWidth(26), ScaleWidth(72), ScaleWidth(72))]; + [self.rightHeaderView addRoundedCornersWithRadius:ScaleWidth(36)]; + self.rightHeaderView.layer.borderWidth = 2; + self.rightHeaderView.layer.borderColor = RGB16(0xffffff).CGColor; + [self.view addSubview:self.rightHeaderView]; + + + self.heartImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_heart_beat_heart_icon"]]; + self.heartImageView.frame = CGRectMake(SCREEN_WIDTH/2-ScaleWidth(26/2), 0, ScaleWidth(26), ScaleWidth(26)); + [self.view addSubview:self.heartImageView]; + + self.heartImageView.centerY = self.leftHeaderView.centerY; + + self.timeLabel = [[UILabel alloc] init]; + self.timeLabel.font = [UIFont systemFontOfSize:14]; + self.timeLabel.textColor = RGB16(0xffffff); + self.timeLabel.backgroundColor = RGB16A(0x0300C8,0.35); + [self.timeLabel addRoundedCornersWithRadius:11.5]; + [self.view addSubview:self.timeLabel]; + + self.recordContentView = [[UIView alloc] initWithFrame:CGRectMake(16, self.topImageView.bottom-ScaleWidth(20), SCREEN_WIDTH-32, self.view.height-self.topImageView.bottom-ScaleWidth(20))]; + self.recordContentView.backgroundColor = RGB16(0xffffff); + [self.recordContentView addRoundedCornersWithRadius:12]; + + + self.expView = [[UIView alloc] initWithFrame:CGRectMake(14, 14, self.recordContentView.width-28, ScaleWidth(89))]; + [self.recordContentView addSubview:self.expView]; + + UIImageView *expImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_heart_beat_exp_bg"]]; + expImageView.frame = self.expView.bounds; + [self.expView addSubview:expImageView]; + + self.expLabel = [[UILabel alloc] initWithFrame:CGRectMake(127, (self.expView.height-32)/2, self.expView.width-127-10, 32)]; + self.expLabel.textColor = RGB16(0xffffff); + self.expLabel.font = [UIFont systemFontOfSize:16]; + [self.expView addSubview:self.expLabel]; + + [self.recordContentView addSubview:self.tableView]; + [self.view addSubview:self.recordContentView]; +// user_heart_beat_exp_bg + self.cpDressBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"heart_beat_space_dress_bg"]]; + self.cpDressBgImageView.frame = CGRectMake(self.view.width-ScaleWidth(115), 0, ScaleWidth(115), ScaleWidth(210)); + [self.view addSubview:self.cpDressBgImageView]; + self.cpDressBgImageView.centerY = self.leftHeaderView.centerY; +// [self.cpDressBgImageView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.right.equalTo(self.view); +// make.centerY.equalTo(self.leftHeaderView); +// make.width.mas_equalTo(ScaleWidth(115)); +// make.height.mas_equalTo(ScaleWidth(210)); +// }]; + + self.cpDressView = [[QXUserCpDressView alloc] initWithFrame:self.cpDressBgImageView.frame]; + [self.cpDressView hideHeader]; + [self.view addSubview:self.cpDressView]; +// [self.cpDressView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.edges.equalTo(self.cpDressBgImageView); +// }]; + self.cpDressView.hidden = YES; + self.cpDressBgImageView.hidden = YES; +} +-(void)helpAction{ + QXHeartBeatLevelRuleView *view = [[QXHeartBeatLevelRuleView alloc] init]; + NSString *urlStr = [NSString stringWithFormat:@"%@api/Page/page_show?id=31",ServerUrl]; + view.rule = urlStr; + [view showInView:self.view]; +} + +-(void)setUserId:(NSString *)userId{ + _userId = userId; + self.page = 1; + [self getList]; +} +-(void)getList{ + MJWeakSelf + [QXMineNetwork heartBeatUserInfoWithUserId:self.userId page:self.page successBlock:^(QXUserCpInfoModel * _Nonnull model) { + if (weakSelf.page == 1) { + if ([model.user_info1.user_id isEqualToString:weakSelf.userId]) { + [weakSelf.leftHeaderView setHeadIcon:model.user_info1.avatar dress:model.user_info1.dress]; + [weakSelf.rightHeaderView setHeadIcon:model.user_info2.avatar dress:model.user_info2.dress]; + }else{ + [weakSelf.leftHeaderView setHeadIcon:model.user_info2.avatar dress:model.user_info2.dress]; + [weakSelf.rightHeaderView setHeadIcon:model.user_info1.avatar dress:model.user_info1.dress]; + } + if ([model.pendant isExist]) { + weakSelf.cpDressView.hidden = NO; + weakSelf.cpDressBgImageView.hidden = NO; + weakSelf.cpDressView.model = model; + } + + NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970]; + long long milliseconds = (long long)(currentTime); + NSInteger time = milliseconds - model.createtime.longLongValue; + weakSelf.timeLabel.text = [NSString stringWithFormat:@" 我们在一起%@啦 ",[NSString getTimeWithDay:time]]; + [weakSelf.timeLabel sizeToFit]; + weakSelf.timeLabel.centerX = weakSelf.topImageView.centerX; + weakSelf.timeLabel.height = 21; + weakSelf.timeLabel.top = weakSelf.leftHeaderView.bottom+ScaleWidth(21); + if (model.next_level_exp.integerValue <=0 ) { + weakSelf.expLabel.text = @"当前已是最高等级"; + }else{ + NSString *expString = [NSString stringWithFormat:@"还需%@经验升级",model.next_level_exp]; + NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:expString]; + [attr yy_setFont:[UIFont fontWithName:@"DIN Condensed" size:32] range:[expString rangeOfString:model.next_level_exp]]; + [attr yy_setColor:RGB16(0xFFF022) range:[expString rangeOfString:model.next_level_exp]]; + weakSelf.expLabel.attributedText = attr; + } + [weakSelf.dataArray removeAllObjects]; + } + [weakSelf.dataArray addObjectsFromArray:model.gift_log]; + [weakSelf.tableView reloadData]; + if (model.gift_log.count == 0) { + weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; + }else{ + [weakSelf.tableView.mj_footer endRefreshing]; + } + [weakSelf.tableView.mj_header endRefreshing]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + [weakSelf.tableView.mj_header endRefreshing]; + [weakSelf.tableView.mj_footer endRefreshing]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [weakSelf.navigationController popViewControllerAnimated:YES]; + }); + }]; +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return self.dataArray.count; +} +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + QXHeartBeatSpaceRecordCell *cell = [QXHeartBeatSpaceRecordCell cellWithTableView:tableView]; + cell.userId = self.userId; + cell.model = self.dataArray[indexPath.row]; + return cell; +} + +-(UITableView *)tableView{ + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(14,self.expView.bottom+6,self.recordContentView.width-28,self.recordContentView.height-self.expView.bottom-14-6) style:(UITableViewStylePlain)]; + _tableView.dataSource = self; + _tableView.delegate = self; + _tableView.backgroundColor = RGB16(0xF4F4F4); + [_tableView addRoundedCornersWithRadius:12]; + _tableView.tableFooterView = [UIView new]; + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + _tableView.rowHeight = UITableViewAutomaticDimension; + _tableView.showsVerticalScrollIndicator = NO; + _tableView.showsHorizontalScrollIndicator = NO; + if (@available(iOS 15.0, *)) { + _tableView.sectionHeaderTopPadding = 0; + } else { + // Fallback on earlier versions + } + MJWeakSelf + _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + weakSelf.page = 1; + [weakSelf getList]; + }]; + _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ + weakSelf.page++; + [weakSelf getList]; + }]; + } + return _tableView; +} @end diff --git a/QXLive/Mine(音域)/Controller/亲密关系/QXIntimateViewController.m b/QXLive/Mine(音域)/Controller/亲密关系/QXIntimateViewController.m index d9d4254..3f47b39 100644 --- a/QXLive/Mine(音域)/Controller/亲密关系/QXIntimateViewController.m +++ b/QXLive/Mine(音域)/Controller/亲密关系/QXIntimateViewController.m @@ -14,8 +14,9 @@ #import "QXMoreIntimateViewController.h" #import "QXIntimateMoreListCell.h" #import "QXHeartBeatSpaceViewController.h" +#import "QXUserHomePageViewController.h" -@interface QXIntimateViewController () +@interface QXIntimateViewController () @property (nonatomic,strong)UITableView *tableView; @property (nonatomic,strong)QXRoomBestFriendModel *model; @end @@ -79,6 +80,7 @@ QXMoreIntimateViewController *vc = [[QXMoreIntimateViewController alloc] init]; vc.userId = self.userId; vc.relation_id = md.relation_list.firstObject.relation_id; + vc.relation_name = md.relation_name; [self.navigationController pushViewController:vc animated:YES]; } @@ -98,7 +100,9 @@ if (indexPath.section == 0) { if (self.model.cp) { QXIntimateCpCell *cell = [QXIntimateCpCell cellWithTableView:tableView]; + cell.userId = self.userId; cell.model = self.model.cp; + cell.delegate = self; return cell; }else{ QXIntimateNoCpCell *cell = [QXIntimateNoCpCell cellWithTableView:tableView]; @@ -108,6 +112,7 @@ QXRoomBestFriendListModel *md = self.dataArray[indexPath.section-1]; if (md.relation_list.count > 1) { QXIntimateListCell*cell = [QXIntimateListCell cellWithTableView:tableView]; + cell.userId = self.userId; if (self.dataArray.count>0) { QXRoomBestFriendListModel *md = self.dataArray[indexPath.section-1]; cell.model = md; @@ -116,8 +121,10 @@ }else{ MJWeakSelf QXIntimateMoreListCell *cell = [QXIntimateMoreListCell cellWithTableView:tableView]; + cell.userId = self.userId; QXRoomBestFriendListModel *md = self.dataArray.firstObject; cell.model = md.relation_list.firstObject; + cell.delegate = self; cell.deleteSuccessBlock = ^(QXRelationshipListModel * _Nonnull model) { weakSelf.page = 1; [weakSelf getList]; @@ -184,13 +191,13 @@ } }else{ QXRoomBestFriendListModel *md = self.dataArray[indexPath.section-1]; - if (md.relation_list.count > 1) { + if (md.relation_list.count == 1) { return ScaleWidth(92)+18; }else{ if (md.relation_list.count == 0) { return 0; }else{ - return ScaleWidth(100)+16; + return ScaleWidth(125); } } @@ -206,14 +213,35 @@ return 15; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - if (indexPath.section == 0) { - if (self.model.cp) { - QXHeartBeatSpaceViewController *vc = [[QXHeartBeatSpaceViewController alloc] init]; - vc.userId = self.userId; - [self.navigationController pushViewController:vc animated:YES]; - } +// if (indexPath.section == 0) { +// if (self.model.cp) { +// QXHeartBeatSpaceViewController *vc = [[QXHeartBeatSpaceViewController alloc] init]; +// vc.userId = self.userId; +// [self.navigationController pushViewController:vc animated:YES]; +// } +// } +} + +-(void)didClickHeaderCardViewWithUserId:(NSString *)userId{ + if (self.model.cp) { + QXHeartBeatSpaceViewController *vc = [[QXHeartBeatSpaceViewController alloc] init]; + vc.userId = self.userId; + [self.navigationController pushViewController:vc animated:YES]; } } + +-(void)didClickHeaderViewUserId:(NSString *)userId{ + QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init]; + vc.user_id = userId; + [self.navigationController pushViewController:vc animated:YES]; + +} +- (void)didClickHeaderWithUserId:(NSString *)userId{ + QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init]; + vc.user_id = userId; + [self.navigationController pushViewController:vc animated:YES]; +} + -(UITableView *)tableView{ if (!_tableView) { _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight+ScaleWidth(68), SCREEN_WIDTH, SCREEN_HEIGHT -NavContentHeight-ScaleWidth(68)) style:(UITableViewStyleGrouped)]; diff --git a/QXLive/Mine(音域)/Controller/亲密关系/QXMoreIntimateViewController.h b/QXLive/Mine(音域)/Controller/亲密关系/QXMoreIntimateViewController.h index 50c69c2..6630e30 100644 --- a/QXLive/Mine(音域)/Controller/亲密关系/QXMoreIntimateViewController.h +++ b/QXLive/Mine(音域)/Controller/亲密关系/QXMoreIntimateViewController.h @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface QXMoreIntimateViewController : QXBaseViewController @property (nonatomic,strong)NSString *userId; @property (nonatomic,strong)NSString *relation_id; +@property (nonatomic,strong)NSString *relation_name; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Controller/亲密关系/QXMoreIntimateViewController.m b/QXLive/Mine(音域)/Controller/亲密关系/QXMoreIntimateViewController.m index d907673..5a0da90 100644 --- a/QXLive/Mine(音域)/Controller/亲密关系/QXMoreIntimateViewController.m +++ b/QXLive/Mine(音域)/Controller/亲密关系/QXMoreIntimateViewController.m @@ -16,9 +16,30 @@ @implementation QXMoreIntimateViewController - (void)viewDidLoad { + self.isNoChangeBgImage = YES; [super viewDidLoad]; // Do any additional setup after loading the view. } +-(void)viewWillAppear:(BOOL)animated{ + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:NO animated:YES]; +} +-(void)initSubViews{ + [super initSubViews]; + self.page = 1; + [self updateBgImage:@"mine_intimate_bg"]; + [self updateBackImage:[UIImage imageNamed:@"mine_intimate_back"]]; + UIImageView *titleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_intimate_title_img"]]; + [self.view addSubview:titleImageView]; + [titleImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self.view); + make.width.mas_equalTo(ScaleWidth(178)); + make.height.mas_equalTo(ScaleWidth(68)); + make.top.mas_equalTo(NavContentHeight); + }]; + [self.view addSubview:self.tableView]; + +} -(void)setUserId:(NSString *)userId{ _userId = userId; } @@ -33,6 +54,7 @@ } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ QXIntimateMoreListCell *cell = [QXIntimateMoreListCell cellWithTableView:tableView]; + cell.userId = self.userId; cell.model = self.dataArray[indexPath.row]; MJWeakSelf cell.topSuccessBlock = ^(QXRelationshipListModel * _Nonnull model) { @@ -46,7 +68,29 @@ -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return ScaleWidth(92)+16; } - +-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ + UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 50)]; + UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_intimate_title_bg"]]; + UILabel *titleLabel = [[UILabel alloc] init]; + titleLabel.font = [UIFont boldSystemFontOfSize:16]; + titleLabel.textColor = RGB16(0xffffff); + [header addSubview:imageView]; + [header addSubview:titleLabel]; + [imageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(132); + make.height.mas_equalTo(36); + make.centerX.centerY.equalTo(header); + }]; + [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(header); + make.centerY.equalTo(header).offset(2); + }]; + titleLabel.text = self.relation_name; + return header; +} +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ + return 50; +} -(void)getList{ MJWeakSelf [QXMineNetwork userBestFriendsMoreListWithUserId:self.userId relation_id:self.relation_id successBlock:^(NSArray * _Nonnull model) { diff --git a/QXLive/Mine(音域)/Controller/家族/QXFamilyPriceRecordViewController.h b/QXLive/Mine(音域)/Controller/家族/QXFamilyPriceRecordViewController.h new file mode 100644 index 0000000..7ee5212 --- /dev/null +++ b/QXLive/Mine(音域)/Controller/家族/QXFamilyPriceRecordViewController.h @@ -0,0 +1,16 @@ +// +// QXFamilyPriceRecordViewController.h +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXFamilyPriceRecordViewController : QXBaseViewController +@property (nonatomic,strong)NSString *userId; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Controller/家族/QXFamilyPriceRecordViewController.m b/QXLive/Mine(音域)/Controller/家族/QXFamilyPriceRecordViewController.m new file mode 100644 index 0000000..d3e0a05 --- /dev/null +++ b/QXLive/Mine(音域)/Controller/家族/QXFamilyPriceRecordViewController.m @@ -0,0 +1,129 @@ +// +// QXFamilyPriceRecordViewController.m +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXFamilyPriceRecordViewController.h" +#import "QXWalletDateView.h" +#import "QXFamilyPriceRecordCell.h" +#import "QXMineNetwork.h" + +@interface QXFamilyPriceRecordViewController () +@property (nonatomic,strong)UIView *contentView; +@property (nonatomic,strong)UITableView *tableView; +@property (nonatomic,strong)QXWalletDateView *dateView; + +@property (nonatomic,strong)NSString* startTime; +@property (nonatomic,strong)NSString* endTime; +@end + +@implementation QXFamilyPriceRecordViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} +-(void)viewWillAppear:(BOOL)animated{ + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:NO animated:YES]; +} +-(void)setNavgationItems{ + [super setNavgationItems]; + self.navigationItem.title = QXText(@"总收益"); +} +-(void)initSubViews{ + self.page = 1; + UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, SCREEN_HEIGHT-NavContentHeight-12)]; + [contentView addRoundedCornersWithRadius:16]; + contentView.backgroundColor = RGB16(0xffffff); + self.contentView = contentView; + [self.view addSubview:contentView]; + + [contentView addSubview:self.dateView]; + [contentView addSubview:self.tableView]; +} +-(void)setUserId:(NSString *)userId{ + _userId = userId; + self.page = 1; + [self getList]; +} +-(void)getList{ + __weak typeof(self) weakSelf = self; + [QXMineNetwork getFamilyEarningWithUserId:self.userId successBlock:^(NSArray * _Nonnull list) { + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated, skipping hide operation"); + return; + } + if (strongSelf.page == 1) { + [strongSelf.dataArray removeAllObjects]; + } + [strongSelf.dataArray addObjectsFromArray:list]; + [strongSelf.tableView reloadData]; + if (list.count == 0) { + strongSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; + }else{ + [strongSelf.tableView.mj_footer endRefreshing]; + } + [strongSelf.tableView.mj_header endRefreshing]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + dispatch_async(dispatch_get_main_queue(), ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf.tableView.mj_header endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; + } + }); + }]; +// +// }]; +} +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return self.dataArray.count; +} +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + QXFamilyPriceRecordCell *cell = [QXFamilyPriceRecordCell cellWithTableView:tableView]; + cell.model = self.dataArray[indexPath.row]; + return cell; +} +#pragma mark - QXWalletDateViewDelegate +-(void)didSelectedStartDate:(NSString *)startDateString startDate:(NSDate *)startDate endDateString:(NSString *)endDateString endDate:(NSDate *)endDate{ + QXLOG(@"开始时间-%@ 结束时间-%@",startDateString,endDateString); + self.startTime = startDateString; + self.endTime = endDateString; + self.page = 1; + [self getList]; +} + + +-(QXWalletDateView *)dateView{ + if (!_dateView) { + _dateView = [[QXWalletDateView alloc] initWithFrame:CGRectMake(12, 12, SCREEN_WIDTH-32-24, 38)]; + _dateView.delegate = self; + } + return _dateView; +} +-(UITableView *)tableView{ + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.dateView.bottom+10, SCREEN_WIDTH-32, self.contentView.height - self.dateView.bottom-10) style:(UITableViewStylePlain)]; + _tableView.dataSource = self; + _tableView.delegate = self; + _tableView.backgroundColor = [UIColor whiteColor]; + _tableView.tableFooterView = [UIView new]; + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + _tableView.rowHeight = 107; + MJWeakSelf + _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + weakSelf.page = 1; + [weakSelf getList]; + }]; + _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ + weakSelf.page++; + [weakSelf getList]; + }]; + } + return _tableView; +} +@end diff --git a/QXLive/Mine(音域)/Controller/家族/QXFamilySubViewController.h b/QXLive/Mine(音域)/Controller/家族/QXFamilySubViewController.h new file mode 100644 index 0000000..5963a0c --- /dev/null +++ b/QXLive/Mine(音域)/Controller/家族/QXFamilySubViewController.h @@ -0,0 +1,17 @@ +// +// QXFamilySubViewController.h +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXFamilySubViewController : QXBaseViewController +@property (nonatomic,assign)NSInteger index; + +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Controller/家族/QXFamilySubViewController.m b/QXLive/Mine(音域)/Controller/家族/QXFamilySubViewController.m new file mode 100644 index 0000000..b0ee130 --- /dev/null +++ b/QXLive/Mine(音域)/Controller/家族/QXFamilySubViewController.m @@ -0,0 +1,145 @@ +// +// QXFamilySubViewController.m +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXFamilySubViewController.h" +#import "QXFamilyMemberCell.h" +#import "QXFamilyTopCell.h" +#import "QXMineNetwork.h" +@interface QXFamilySubViewController () +@property (nonatomic,strong)UITableView *tableView; +@property (nonatomic,strong)QXFamilyModel *model; + +@end + +@implementation QXFamilySubViewController +-(UIView *)listView{ + return self.view; +} +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} +- (void)initSubViews{ + self.bgImageHidden = YES; + self.view.backgroundColor = RGB16(0x102477); + [self.view addSubview:self.tableView]; +} +-(void)viewDidLayoutSubviews{ + [super viewDidLayoutSubviews]; + _tableView.frame = self.view.bounds; +} + +-(void)setIndex:(NSInteger)index{ + _index = index; + [self getList]; +} +-(void)getList{ + BOOL isJoin = YES; + if (self.index == 0) { + isJoin = YES; + }else{ + isJoin = NO; + } + MJWeakSelf + [QXMineNetwork getMyFamilyIsJoin:isJoin successBlock:^(QXFamilyModel * _Nonnull model) { + weakSelf.model = model; + [weakSelf.tableView reloadData]; + [weakSelf.tableView.mj_header endRefreshing]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; +} +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ + if (self.model) { + return 2; + } + return 0; +} +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + if (section == 0) { + return 1; + }else{ + return self.model.group_members_lists.count; + } +} +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.section == 0) { + QXFamilyTopCell *cell = [QXFamilyTopCell cellWithTableView:tableView]; + cell.model = self.model; + return cell; + }else{ + QXFamilyMemberCell *cell = [QXFamilyMemberCell cellWithTableView:tableView]; + cell.model = self.model.group_members_lists[indexPath.row]; + return cell; + } +} +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.section == 0) { + return 180; + }else{ + return 176; + } +} +-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ + if (section == 0) { + return [UIView new]; + }else{ + UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 50)]; + UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"family_list_section_bg"]]; + UILabel *titleLabel = [[UILabel alloc] init]; + titleLabel.font = [UIFont boldSystemFontOfSize:16]; + titleLabel.textColor = RGB16(0xffffff); + [header addSubview:imageView]; + [header addSubview:titleLabel]; + [imageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(132); + make.height.mas_equalTo(36); + make.centerX.centerY.equalTo(header); + }]; + titleLabel.text = @"家族成员"; + [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(header); + make.centerY.equalTo(header).offset(2); + }]; + return header; + } +} +-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ + if (section == 0) { + return 0; + } + return 50; +} +-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ + return [UIView new]; +} +-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ + return 0; +} + +-(UITableView *)tableView{ + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.view.height) style:(UITableViewStyleGrouped)]; + _tableView.dataSource = self; + _tableView.delegate = self; + _tableView.backgroundColor = [UIColor clearColor]; + _tableView.tableFooterView = [UIView new]; + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + if (@available(iOS 15.0, *)) { + _tableView.sectionHeaderTopPadding = 0; + } else { + // Fallback on earlier versions + } + MJWeakSelf + _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ + [weakSelf getList]; + }]; + } + return _tableView; +} + +@end diff --git a/QXLive/Mine(音域)/Controller/家族/QXFamilyViewController.h b/QXLive/Mine(音域)/Controller/家族/QXFamilyViewController.h new file mode 100644 index 0000000..364c9e3 --- /dev/null +++ b/QXLive/Mine(音域)/Controller/家族/QXFamilyViewController.h @@ -0,0 +1,16 @@ +// +// QXFamilyViewController.h +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXBaseViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXFamilyViewController : QXBaseViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Controller/家族/QXFamilyViewController.m b/QXLive/Mine(音域)/Controller/家族/QXFamilyViewController.m new file mode 100644 index 0000000..c764c7d --- /dev/null +++ b/QXLive/Mine(音域)/Controller/家族/QXFamilyViewController.m @@ -0,0 +1,88 @@ +// +// QXFamilyViewController.m +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXFamilyViewController.h" +#import "QXFamilySubViewController.h" + +@interface QXFamilyViewController () +@property (nonatomic,strong)UIImageView *topImageView; +@property (nonatomic,strong)JXCategoryTitleView *categoryView; +@property (nonatomic,strong)JXCategoryListContainerView *containerView; +@property (nonatomic,strong)NSMutableArray *titles; +@end + +@implementation QXFamilyViewController + +- (void)viewDidLoad { + self.isNoChangeBgImage = YES; + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +-(void)viewWillAppear:(BOOL)animated{ + [super viewWillAppear:animated]; + [self.navigationController setNavigationBarHidden:NO animated:YES]; + self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:RGB16(0xffffff)}; +} +-(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); +} +- (void)initSubViews{ + self.titles = [NSMutableArray arrayWithArray:@[@"我的家族",@"我加入的家族"]]; + self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_family_top_bg"]]; + self.topImageView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(435)); + [self.view addSubview:self.topImageView]; + self.view.backgroundColor = RGB16(0x102477); + + self.categoryView = [[JXCategoryTitleView alloc] init]; + self.categoryView.frame = CGRectMake((self.view.width-246)/2, NavContentHeight+ScaleWidth(236), 246, 38); + self.categoryView.delegate = self; + self.categoryView.titles = self.titles; + self.categoryView.backgroundColor = RGB16A(0x000000, 0.2); + [self.categoryView addRoundedCornersWithRadius:19]; + self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#333333"]; + self.categoryView.titleColor = [UIColor colorWithHexString:@"#ffffff"]; + self.categoryView.cellWidth = 123; + self.categoryView.contentEdgeInsetLeft = 0; + self.categoryView.cellSpacing = 0; + self.categoryView.contentEdgeInsetLeft = 0; +// self.categoryView.titleLabelZoomScale = 1.1; +// self.categoryView.titleLabelZoomEnabled = YES; + self.categoryView.titleFont = [UIFont boldSystemFontOfSize:14]; + self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:14]; + self.categoryView.averageCellSpacingEnabled = NO; + JXCategoryIndicatorBackgroundView *indicatorView = [[JXCategoryIndicatorBackgroundView alloc] init]; + indicatorView.indicatorWidth = 123; + indicatorView.indicatorHeight = 38; + indicatorView.indicatorCornerRadius = 19; + indicatorView.indicatorColor = RGB16(0xA4FFB8); + self.categoryView.indicators = @[indicatorView]; + self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_CollectionView) delegate:self]; + self.containerView.frame = CGRectMake(0, self.categoryView.bottom+8, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom-8); + [self.view addSubview:self.categoryView]; + [self.view addSubview:self.containerView]; + self.categoryView.listContainer = self.containerView; +} +-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{ + return self.titles.count; +} +-(id)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{ + QXFamilySubViewController *vc = [[QXFamilySubViewController alloc] init]; + vc.index = index; + return vc; +} + + + + +@end diff --git a/QXLive/Mine(音域)/Controller/我的房间/QXRoomDetailViewController.m b/QXLive/Mine(音域)/Controller/我的房间/QXRoomDetailViewController.m index 9a35a9b..34a8854 100644 --- a/QXLive/Mine(音域)/Controller/我的房间/QXRoomDetailViewController.m +++ b/QXLive/Mine(音域)/Controller/我的房间/QXRoomDetailViewController.m @@ -57,14 +57,19 @@ [self.navigationController pushViewController:vc animated:YES]; } -(void)getPriceData{ - MJWeakSelf + __weak typeof(self) weakSelf = self; [QXMineNetwork roomWaterDetailWithRoomId:self.room_id start_time:self.startTime end_time:self.endTime page:self.page type:self.type successBlock:^(QXRoomDetailModel * _Nonnull model) { - weakSelf.headerView.model = model; - if (weakSelf.page == 1) { - [weakSelf.dict removeAllObjects]; + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated, skipping hide operation"); + return; + } + strongSelf.headerView.model = model; + if (strongSelf.page == 1) { + [strongSelf.dict removeAllObjects]; } - NSArray *arr = [weakSelf.dict allKeys]; + NSArray *arr = [strongSelf.dict allKeys]; for (QXRoomWaterModel*md in model.list) { BOOL haveKey = NO; for (NSString *s in arr) { @@ -75,10 +80,10 @@ } if (!haveKey) { // key没有包含某个日期,设置日期的流水json - [weakSelf.dict setObject:[md yy_modelToJSONString] forKey:md.time]; + [strongSelf.dict setObject:[md yy_modelToJSONString] forKey:md.time]; }else{ //有包含某个日期,先取出之前已有的数据 - NSString *json = [weakSelf.dict objectForKey:md.time]; + NSString *json = [strongSelf.dict objectForKey:md.time]; //转换为模型 QXRoomWaterModel *m = [QXRoomWaterModel yy_modelWithJSON:json]; //旧数据 @@ -88,10 +93,10 @@ //赋值于历史数据 m.list = newArr; // 重新设置键值对 - [weakSelf.dict setObject:[m yy_modelToJSONString] forKey:md.time]; + [strongSelf.dict setObject:[m yy_modelToJSONString] forKey:md.time]; } } - NSArray *keys = [weakSelf.dict.allKeys sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { + NSArray *keys = [strongSelf.dict.allKeys sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { // NSString *s1 = obj1; // NSString *s2 = obj2; NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init]; @@ -110,18 +115,23 @@ return NSOrderedSame; } }]; - self.allDateArray = [NSMutableArray arrayWithArray:keys]; - [weakSelf.tableView reloadData]; - [weakSelf.tableView.mj_header endRefreshing]; + strongSelf.allDateArray = [NSMutableArray arrayWithArray:keys]; + [strongSelf.tableView reloadData]; + [strongSelf.tableView.mj_header endRefreshing]; if (model.list.count == 0) { - weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; + strongSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; }else{ - [weakSelf.tableView.mj_footer endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; } } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - showToast(msg); - [weakSelf.tableView.mj_footer endRefreshing]; - [weakSelf.tableView.mj_header endRefreshing]; + dispatch_async(dispatch_get_main_queue(), ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + showToast(msg); + [strongSelf.tableView.mj_header endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; + } + }); }]; } diff --git a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m index 6648ac8..ca5a92e 100644 --- a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m +++ b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m @@ -74,15 +74,22 @@ if (self.model == nil) { return 0; } - return 3; + if (self.model.tasks.teacher_tasks.count > 0) { + return 4; + }else{ + return 3; + } + } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ if (section == 0) { return self.model.tasks.daily_tasks.count; }else if(section == 1){ return self.model.tasks.daily_tasks_special.count; - }else{ + }else if(section == 2){ return self.model.tasks.usual_tasks.count; + }else{ + return self.model.tasks.teacher_tasks.count; } } @@ -93,8 +100,10 @@ model = self.model.tasks.daily_tasks[indexPath.row]; }else if(indexPath.section == 1){ model = self.model.tasks.daily_tasks_special[indexPath.row]; - }else{ + }else if(indexPath.section == 2){ model = self.model.tasks.usual_tasks[indexPath.row]; + }else{ + model = self.model.tasks.teacher_tasks[indexPath.row]; } cell.model = model; return cell; @@ -110,8 +119,10 @@ titleLabel.text = QXText(@"每日任务"); }else if(section == 1){ titleLabel.text = QXText(@"特殊任务"); - }else{ + }else if(section == 2){ titleLabel.text = QXText(@"平台任务"); + }else{ + titleLabel.text = QXText(@"师徒任务"); } [header addSubview:titleLabel]; return header; diff --git a/QXLive/Mine(音域)/Controller/钱包/QXCornRecordSubViewController.m b/QXLive/Mine(音域)/Controller/钱包/QXCornRecordSubViewController.m index d707cad..8fea8b3 100644 --- a/QXLive/Mine(音域)/Controller/钱包/QXCornRecordSubViewController.m +++ b/QXLive/Mine(音域)/Controller/钱包/QXCornRecordSubViewController.m @@ -40,22 +40,33 @@ // [self.dataArray addObject:@""]; // [self.tableView reloadData]; // - MJWeakSelf + __weak typeof(self) weakSelf = self; [QXMineNetwork roomCoinOrDiamondDetailWithPage:self.page in_out_type:[NSString stringWithFormat:@"%ld",self.type+1] start_time:self.startTime end_time:self.endTime gift_type:[NSString stringWithFormat:@"%ld",self.waterType+1] successBlock:^(NSArray * _Nonnull list) { - if (weakSelf.page == 1) { - [weakSelf.dataArray removeAllObjects]; + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated, skipping hide operation"); + return; } - [weakSelf.dataArray addObjectsFromArray:list]; - [weakSelf.tableView reloadData]; + if (strongSelf.page == 1) { + [strongSelf.dataArray removeAllObjects]; + } + [strongSelf.dataArray addObjectsFromArray:list]; + [strongSelf.tableView reloadData]; if (list.count == 0) { - weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; + strongSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; }else{ - [weakSelf.tableView.mj_footer endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; } - [weakSelf.tableView.mj_header endRefreshing]; + [strongSelf.tableView.mj_header endRefreshing]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - [weakSelf.tableView.mj_header endRefreshing]; - [weakSelf.tableView.mj_footer endRefreshing]; + dispatch_async(dispatch_get_main_queue(), ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf.tableView.mj_header endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; + } + }); + }]; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ diff --git a/QXLive/Mine(音域)/Controller/钱包/QXWithDrawRecordVC.m b/QXLive/Mine(音域)/Controller/钱包/QXWithDrawRecordVC.m index a44c112..bf09c76 100644 --- a/QXLive/Mine(音域)/Controller/钱包/QXWithDrawRecordVC.m +++ b/QXLive/Mine(音域)/Controller/钱包/QXWithDrawRecordVC.m @@ -43,22 +43,32 @@ self.page = 1; } -(void)getData{ - MJWeakSelf + __weak typeof(self) weakSelf = self; [QXMineNetwork walletWithDrawRecordWithPage:self.page start_time:self.startTime end_time:self.endTime SuccessBlock:^(NSArray * _Nonnull list) { - if (weakSelf.page == 1) { - [weakSelf.dataArray removeAllObjects]; + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated, skipping hide operation"); + return; } - [weakSelf.dataArray addObjectsFromArray:list]; - [weakSelf.tableView reloadData]; + if (strongSelf.page == 1) { + [strongSelf.dataArray removeAllObjects]; + } + [strongSelf.dataArray addObjectsFromArray:list]; + [strongSelf.tableView reloadData]; if (list.count == 0) { - weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; + strongSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; }else{ - [weakSelf.tableView.mj_footer endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; } - [weakSelf.tableView.mj_header endRefreshing]; + [strongSelf.tableView.mj_header endRefreshing]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - [weakSelf.tableView.mj_header endRefreshing]; - [weakSelf.tableView.mj_footer endRefreshing]; + dispatch_async(dispatch_get_main_queue(), ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf.tableView.mj_header endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; + } + }); }]; } diff --git a/QXLive/Mine(音域)/Model/QXDayTaskModel.h b/QXLive/Mine(音域)/Model/QXDayTaskModel.h index fcf2215..4ace523 100644 --- a/QXLive/Mine(音域)/Model/QXDayTaskModel.h +++ b/QXLive/Mine(音域)/Model/QXDayTaskModel.h @@ -48,6 +48,7 @@ NS_ASSUME_NONNULL_BEGIN /// 平台任务列表 @property(nonatomic,strong)NSArray *usual_tasks; +@property(nonatomic,strong)NSArray *teacher_tasks; @end @@ -74,6 +75,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic,strong)NSString *from_id; /// 0 记录次数 1 计时 @property(nonatomic,strong)NSString *is_time; +/// 奖励类型 1金币 2钻石 +@property(nonatomic,strong)NSString *reward_type; @end diff --git a/QXLive/Mine(音域)/Model/QXDayTaskModel.m b/QXLive/Mine(音域)/Model/QXDayTaskModel.m index c9acecd..9ef7e3f 100644 --- a/QXLive/Mine(音域)/Model/QXDayTaskModel.m +++ b/QXLive/Mine(音域)/Model/QXDayTaskModel.m @@ -28,6 +28,7 @@ @"daily_tasks" : @"QXDayTaskListModel", @"usual_tasks" : @"QXDayTaskListModel", @"daily_tasks_special": @"QXDayTaskListModel", + @"teacher_tasks": @"QXDayTaskListModel", }; } diff --git a/QXLive/Mine(音域)/Model/QXFamilyModel.h b/QXLive/Mine(音域)/Model/QXFamilyModel.h new file mode 100644 index 0000000..ae88682 --- /dev/null +++ b/QXLive/Mine(音域)/Model/QXFamilyModel.h @@ -0,0 +1,86 @@ +// +// QXFamilyModel.h +// QXLive +// +// Created by 启星 on 2025/11/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class QXFamilyMemberModel; +@interface QXFamilyModel : NSObject +/// 群组id +@property(nonatomic,strong)NSString *group_id; +/// 家族名称 +@property(nonatomic,strong)NSString *name; +/// 族长id(群主id) +@property(nonatomic,strong)NSString *user_id; +/// 签约次数(群组人数) +@property(nonatomic,strong)NSString *group_members_num; +/// 总计收益 +@property(nonatomic,strong)NSString *group_earnings; +/// 族长信息 +@property(nonatomic,strong)QXUserModel *group_owner_info; +/// 家族成员 +@property(nonatomic,strong)NSArray *group_members_lists; + +@end + + +@interface QXFamilyMemberModel : NSObject +/// 身价 +@property(nonatomic,strong)NSString *market_value; +/// 0 离线 1 在线 +@property(nonatomic,assign)NSInteger is_online; +/// 昵称 +@property(nonatomic,strong)NSString *nickname; +/// 头像 +@property(nonatomic,strong)NSString *avatar; +/// 用户code +@property(nonatomic,strong)NSString *user_code; +/// 用户id +@property(nonatomic,strong)NSString *user_id; +/// 剩余多少天 +@property(nonatomic,strong)NSString *end_time; +/// 剩余多少天 +@property(nonatomic,strong)NSString *end_day; +/// 头像框 +@property(nonatomic,strong)NSString *dress; +/// 头像框 +@property(nonatomic,strong)NSArray *icon; +/// 麦圈 +@property(nonatomic,strong)NSString *mic_cycle; +/// 爵位 +@property(nonatomic,strong)NSString *nobility_image; +/// 昵称颜色 +@property(nonatomic,strong)NSString *nickname_color; +/// 免费续签次数 +@property(nonatomic,strong)NSString *free_renewal; +/// 今日收礼收益 +@property(nonatomic,strong)NSString *today_earnings; +/// 昨日收礼收益 +@property(nonatomic,strong)NSString *yesterday_earnings; +/// 是否显示续约按钮 1:显示 0:不显示 +@property(nonatomic,strong)NSString *is_show_sign; +@end + +@interface QXFamilyEarningModel : NSObject +/// 列表 id +@property(nonatomic,strong)NSString *id; +/// 用户昵称 +@property(nonatomic,strong)NSString *nickname; +/// 头像 +@property(nonatomic,strong)NSString *avatar; +/// 用户code +@property(nonatomic,strong)NSString *user_code; +/// 收益 +@property(nonatomic,strong)NSString *earnings; +/// 时间 +@property(nonatomic,strong)NSString *createtime; +/// 礼物名称 +@property(nonatomic,strong)NSString *gift_name; +/// 礼物价格 +@property(nonatomic,strong)NSString *gift_price; +@end +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Model/QXFamilyModel.m b/QXLive/Mine(音域)/Model/QXFamilyModel.m new file mode 100644 index 0000000..a89aab0 --- /dev/null +++ b/QXLive/Mine(音域)/Model/QXFamilyModel.m @@ -0,0 +1,31 @@ +// +// QXFamilyModel.m +// QXLive +// +// Created by 启星 on 2025/11/27. +// + +#import "QXFamilyModel.h" + +@implementation QXFamilyModel ++(NSDictionary *)modelContainerPropertyGenericClass{ + return @{ + @"group_owner_info" : @"QXFamilyMemberModel", + @"group_members_lists" : @"QXFamilyMemberModel", + }; +} + +@end + + +@implementation QXFamilyMemberModel + + + +@end + +@implementation QXFamilyEarningModel + + + +@end diff --git a/QXLive/Mine(音域)/Model/QXRoomModel.h b/QXLive/Mine(音域)/Model/QXRoomModel.h index b94ef33..4723dc0 100644 --- a/QXLive/Mine(音域)/Model/QXRoomModel.h +++ b/QXLive/Mine(音域)/Model/QXRoomModel.h @@ -11,7 +11,7 @@ #import "QXUserSongListModel.h" NS_ASSUME_NONNULL_BEGIN -@class QXRoomInfoModel,QXRoomPitModel,QXRoomOwnerModel,QXHeadLineModel,QXRoomAuction,QXRoomAuctionUser,QXRoomCpUser,QXRoomPkInfo,QXRoomFriendInfo,QXRoomFriendHeartListModel,QXRoomActivitySubModel,QXRoomActivityModel,QXSingerInfo; +@class QXRoomInfoModel,QXRoomPitModel,QXRoomOwnerModel,QXHeadLineModel,QXRoomAuction,QXRoomAuctionUser,QXRoomCpUser,QXRoomPkInfo,QXRoomFriendInfo,QXRoomFriendHeartListModel,QXRoomActivitySubModel,QXRoomActivityModel,QXSingerInfo,QXRoomSignInfo; @interface QXRoomModel : NSObject /// 房间信息 @property (nonatomic,strong)QXRoomInfoModel *room_info; @@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)QXRoomPkInfo *pk_info; /// 交友房信息 @property (nonatomic,strong)QXRoomFriendInfo *friend_info; +/// 签约房信息 +@property (nonatomic,strong)QXRoomSignInfo *sign_info; /// k歌麦位 @property (nonatomic,strong)NSArray< QXRoomPitModel*> *song_pit_list; /// 活动 @@ -385,4 +387,19 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)QXUserSongListModel *song_info; @property (nonatomic,strong)QXUserSongListModel *next_song_info; @end + + +@interface QXRoomSignInfo :NSObject +/// 0 未开始 1进行中 +@property (nonatomic,strong)NSString *sign_status; +/// 签约天数 +@property (nonatomic,strong)NSString *sign_day; +/// 当前身价 +@property (nonatomic,strong)NSString *current_body_value; +/// 倒计时 时间戳 +@property (nonatomic,strong)NSString *end_time; +/// 签约场次id +@property (nonatomic,strong)NSString *sign_id; + +@end NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Model/QXRoomModel.m b/QXLive/Mine(音域)/Model/QXRoomModel.m index 2f3d839..f944364 100644 --- a/QXLive/Mine(音域)/Model/QXRoomModel.m +++ b/QXLive/Mine(音域)/Model/QXRoomModel.m @@ -22,6 +22,7 @@ @"friend_info":@"QXRoomFriendInfo", @"gift_cycle":@"QXRoomActivityModel", @"singer_info":@"QXSingerInfo", + @"sign_info":@"QXRoomSignInfo", }; } @@ -155,4 +156,11 @@ }; } +@end + + +@implementation QXRoomSignInfo + + + @end diff --git a/QXLive/Mine(音域)/Model/QXUserDressModel.h b/QXLive/Mine(音域)/Model/QXUserDressModel.h index 21b07b8..24b6ffc 100644 --- a/QXLive/Mine(音域)/Model/QXUserDressModel.h +++ b/QXLive/Mine(音域)/Model/QXUserDressModel.h @@ -32,6 +32,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)NSString *type; /// 剩余时间 (天) @property (nonatomic,strong)NSString *remaining_day; +/// 多少个 +@property (nonatomic,strong)NSString *num; +/// 降身卡 +@property (nonatomic,strong)NSString *ext_value; @end diff --git a/QXLive/Mine(音域)/Model/QXUserModel.h b/QXLive/Mine(音域)/Model/QXUserModel.h index 24d485b..9abcd8b 100644 --- a/QXLive/Mine(音域)/Model/QXUserModel.h +++ b/QXLive/Mine(音域)/Model/QXUserModel.h @@ -7,7 +7,7 @@ #import -@class QXRelationshipListModel,QXUserCpInfoModel; +@class QXRelationshipListModel,QXUserCpInfoModel,QXUserHeartBeatSpaceLogModel; NS_ASSUME_NONNULL_BEGIN @interface QXUserModel : NSObject @@ -55,6 +55,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,assign)NSInteger is_can_chat; /// 需要充值金额 @property (nonatomic,strong)NSString* can_chat_money; +/// 身价 +@property (nonatomic,strong)NSString* market_value; @end @@ -272,11 +274,31 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)NSString *user_id2; @property (nonatomic,strong)NSString *level; @property (nonatomic,strong)NSString *exp; +@property (nonatomic,strong)NSString *next_level_exp; +@property (nonatomic,strong)NSString *createtime; /// 挂件(装扮)地址 @property (nonatomic,strong)NSString *pendant; /// 挂件上的头像位置:0-上,1-右上,2-右,3-右下,4-下,5-左下,6-左,7-左上' @property (nonatomic,strong)NSString *direction; @property (nonatomic,strong)QXUserModel *user_info1; @property (nonatomic,strong)QXUserModel *user_info2; +@property (nonatomic,strong)NSArray< QXUserHeartBeatSpaceLogModel *>*gift_log; +@end + +@interface QXUserHeartBeatSpaceLogModel : NSObject +@property (nonatomic,strong)NSString *id; +@property (nonatomic,strong)NSString *room_id; +@property (nonatomic,strong)NSString *from_user_id; +@property (nonatomic,strong)NSString *to_user_id; +@property (nonatomic,strong)NSString *gift_id; +@property (nonatomic,strong)NSString *cp_zone_id; +@property (nonatomic,strong)NSString *exp; +@property (nonatomic,strong)NSString *exp_total; +@property (nonatomic,strong)NSString *createtime; +@property (nonatomic,strong)NSString *gift_name; +@property (nonatomic,strong)NSString *num; +@property (nonatomic,strong)NSString *remark; +@property (nonatomic,strong)QXUserModel *from_user_info; +@property (nonatomic,strong)QXUserModel *to_user_info; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Model/QXUserModel.m b/QXLive/Mine(音域)/Model/QXUserModel.m index 7bcb223..3a8c0d8 100644 --- a/QXLive/Mine(音域)/Model/QXUserModel.m +++ b/QXLive/Mine(音域)/Model/QXUserModel.m @@ -93,7 +93,22 @@ // @"zhenai" : @"QXRelationshipListModel" @"user_info1": @"QXUserModel", @"user_info2": @"QXUserModel", + @"gift_log" : @"QXUserHeartBeatSpaceLogModel" }; } +@end + +@implementation QXUserHeartBeatSpaceLogModel + ++(NSDictionary *)modelContainerPropertyGenericClass{ + return @{ +// @"qinmi" : @"QXRelationshipListModel", +// @"zhenai" : @"QXRelationshipListModel" + @"from_user_info": @"QXUserModel", + @"to_user_info": @"QXUserModel", + }; +} + + @end diff --git a/QXLive/Mine(音域)/Services/QXMineNetwork.h b/QXLive/Mine(音域)/Services/QXMineNetwork.h index daa559b..7fd3032 100644 --- a/QXLive/Mine(音域)/Services/QXMineNetwork.h +++ b/QXLive/Mine(音域)/Services/QXMineNetwork.h @@ -30,6 +30,7 @@ #import "QXNobilityGetPriceModel.h" #import "QXUserSongListModel.h" #import "QXRoomBestFriendModel.h" +#import "QXFamilyModel.h" NS_ASSUME_NONNULL_BEGIN @@ -1281,6 +1282,101 @@ NS_ASSUME_NONNULL_BEGIN successBlock:(void (^)(NSArray< QXRelationshipListModel*>* model))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock; +/** + 亲密空间 + */ ++(void)heartBeatUserInfoWithUserId:(NSString*)userId + page:(NSInteger)page + successBlock:(void (^)(QXUserCpInfoModel* model))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 我的家族|我加入的家族 + */ ++(void)getMyFamilyIsJoin:(BOOL)isJoin + successBlock:(void (^)(QXFamilyModel* model))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + + +/** + 家族收益详情 + */ ++(void)getFamilyEarningWithUserId:(NSString*)userId + successBlock:(void (^)(NSArray* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + + +/** + 签约出价价格列表 + userId 当前在签约麦位的用户ID + + */ ++(void)signCoinListWithSignId:(NSString*)signId + successBlock:(void (^)(NSArray* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 签约出价 + userId 当前在签约麦位的用户ID + sign_value 出价价格 + sign_id 场次id + */ ++(void)signCoinWithSign_value:(NSString*)sign_value + sign_id:(NSString*)sign_id + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 签约开始 + userId 当前在签约麦位的用户ID + + */ ++(void)signStartWithRoomId:(NSString*)roomId + userId:(NSString*)userId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 签约结束 + userId 当前在签约麦位的用户ID + signId 场次id + */ ++(void)signEndWithSignId:(NSString*)signId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 签约延时 + userId 当前在签约麦位的用户ID + signId 场次id + */ ++(void)signDelayWithSignId:(NSString*)signId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 才艺列表 + */ ++(void)signGeyPlayListSuccessBlock:(void (^)(NSArray* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + + +/** + 免费续约 + userId 当前在签约麦位的用户ID + */ ++(void)signFreeResignWithUserId:(NSString*)userId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 续签 + userId 当前在签约麦位的用户ID + */ ++(void)signCoinResignWithUserId:(NSString*)userId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + @end diff --git a/QXLive/Mine(音域)/Services/QXMineNetwork.m b/QXLive/Mine(音域)/Services/QXMineNetwork.m index af883b0..739d2a2 100644 --- a/QXLive/Mine(音域)/Services/QXMineNetwork.m +++ b/QXLive/Mine(音域)/Services/QXMineNetwork.m @@ -73,7 +73,7 @@ successBlock:(void (^)(QXUserHomeModel * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{ NSDictionary *parameters =@{ - @"user_id":user_id, + @"user_id":user_id?:@"", }; [[QXRequset shareInstance] postWithUrl:QXGetUserInfo parameters:parameters needCache:NO success:^(id responseObject) { if (successBlock) { @@ -285,7 +285,7 @@ successBlock:(void (^)(NSArray * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{ NSDictionary *parameters =@{ - @"user_id":user_id, + @"user_id":user_id?:@"", @"page":[NSNumber numberWithInteger:page] }; [[QXRequset shareInstance] postWithUrl:QXUserDynamic parameters:parameters needCache:NO success:^(id responseObject) { @@ -2544,4 +2544,222 @@ failBlock(error,msg); }]; } +/** + 亲密空间 + */ ++(void)heartBeatUserInfoWithUserId:(NSString*)userId + page:(NSInteger)page + successBlock:(void (^)(QXUserCpInfoModel* model))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"user_id":userId?:@"", + @"page":[NSNumber numberWithInteger:page] + }; + [[QXRequset shareInstance] postWithUrl:QXHeartBeatSpace parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + QXUserCpInfoModel *model = [QXUserCpInfoModel yy_modelWithJSON:responseObject[@"data"]]; + successBlock(model); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} +/** + 我的家族|我加入的家族 + */ ++(void)getMyFamilyIsJoin:(BOOL)isJoin + successBlock:(void (^)(QXFamilyModel* model))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + + [[QXRequset shareInstance] getWithUrl:QXMyFamily parameters:@{} needCache:NO success:^(id responseObject) { + if (successBlock) { + QXFamilyModel *model = [QXFamilyModel yy_modelWithJSON:responseObject[@"data"]]; + successBlock(model); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + + +/** + 家族收益详情 + */ ++(void)getFamilyEarningWithUserId:(NSString*)userId + successBlock:(void (^)(NSArray* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"user_id":userId?:@"", + }; + [[QXRequset shareInstance] postWithUrl:QXHeartBeatSpace parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + NSArray *list = [NSArray yy_modelArrayWithClass:[QXFamilyEarningModel class] json:responseObject[@"data"]]; + successBlock(list); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 签约出价价格列表 + userId 当前在签约麦位的用户ID + + */ ++(void)signCoinListWithSignId:(NSString *)signId successBlock:(void (^)(NSArray * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{ + NSDictionary *parameters =@{ + @"sign_id":signId?:@"", + }; + [[QXRequset shareInstance] postWithUrl:QXSignCoinList parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + id object = responseObject[@"data"]; + if ([object isKindOfClass:[NSArray class]]) { + successBlock(object); + }else{ + successBlock([NSArray array]); + } + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 签约出价 + userId 当前在签约麦位的用户ID + sign_value 出价价格 + sign_id 场次id + */ ++(void)signCoinWithSign_value:(NSString*)sign_value + sign_id:(NSString*)sign_id + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"sign_value":sign_value?:@"", + @"sign_id":sign_id?:@"" + }; + [[QXRequset shareInstance] postWithUrl:QXSignSignCoin parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 签约开始 + userId 当前在签约麦位的用户ID + + */ ++(void)signStartWithRoomId:(NSString*)roomId + userId:(NSString*)userId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"room_id":roomId?:@"", + @"user_id":userId?:@"" + }; + [[QXRequset shareInstance] postWithUrl:QXSignStartSign parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 签约结束 + userId 当前在签约麦位的用户ID + signId 场次id + */ ++(void)signEndWithSignId:(NSString*)signId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"sign_id":signId?:@"", + }; + [[QXRequset shareInstance] postWithUrl:QXSignEndSign parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 签约延时 + userId 当前在签约麦位的用户ID + signId 场次id + */ ++(void)signDelayWithSignId:(NSString*)signId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"sign_id":signId?:@"", + }; + [[QXRequset shareInstance] postWithUrl:QXSignDelaySign parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 才艺列表 + */ ++(void)signGeyPlayListSuccessBlock:(void (^)(NSArray* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + + [[QXRequset shareInstance] getWithUrl:QXSignPlayList parameters:@{} needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + + +/** + 免费续约 + userId 当前在签约麦位的用户ID + */ ++(void)signFreeResignWithUserId:(NSString*)userId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"user_id":userId?:@"", + }; + [[QXRequset shareInstance] postWithUrl:QXSignFreeResign parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 续签 + userId 当前在签约麦位的用户ID + */ ++(void)signCoinResignWithUserId:(NSString*)userId + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + NSDictionary *parameters =@{ + @"user_id":userId?:@"", + }; + [[QXRequset shareInstance] postWithUrl:QXSignCoinResign parameters:parameters needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} @end diff --git a/QXLive/Mine(音域)/View/QXBodyPriceRuleView.h b/QXLive/Mine(音域)/View/QXBodyPriceRuleView.h new file mode 100644 index 0000000..63082f0 --- /dev/null +++ b/QXLive/Mine(音域)/View/QXBodyPriceRuleView.h @@ -0,0 +1,23 @@ +// +// QXBodyPriceRuleView.h +// QXLive +// +// Created by 启星 on 2025/11/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface QXBodyPriceRuleView : UIView +@property (weak, nonatomic) IBOutlet UILabel *currentPriceLabel; +@property (weak, nonatomic) IBOutlet UILabel *beyoundPriceLabel; +@property (weak, nonatomic) IBOutlet UILabel *recievePriceLabel; +@property (weak, nonatomic) IBOutlet UILabel *realPriceLabel; +@property (weak, nonatomic) IBOutlet UIButton *commitBtn; +@property (weak, nonatomic) IBOutlet UIButton *closeBtn; +@property (weak, nonatomic) IBOutlet UIView *bgView; ++(void)showInView:(UIView*)view; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/QXBodyPriceRuleView.m b/QXLive/Mine(音域)/View/QXBodyPriceRuleView.m new file mode 100644 index 0000000..ddf383f --- /dev/null +++ b/QXLive/Mine(音域)/View/QXBodyPriceRuleView.m @@ -0,0 +1,41 @@ +// +// QXBodyPriceRuleView.m +// QXLive +// +// Created by 启星 on 2025/11/25. +// + +#import "QXBodyPriceRuleView.h" + +@implementation QXBodyPriceRuleView + + ++(void)showInView:(UIView*)view{ + UINib *nib = [UINib nibWithNibName:@"QXBodyPriceRuleView" bundle:[NSBundle mainBundle]]; + QXBodyPriceRuleView *ruleView = [nib instantiateWithOwner:nil options:nil].firstObject; + ruleView.frame = UIScreen.mainScreen.bounds; + ruleView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + ruleView.bgView.alpha = 0; + [view addSubview:ruleView]; + [UIView animateWithDuration:0.2 animations:^{ + ruleView.bgView.alpha = 1; + }completion:^(BOOL finished) { + + }]; +} +- (IBAction)closeAction:(id)sender { + [UIView animateWithDuration:0.2 animations:^{ + self.bgView.alpha = 0; + }completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; +} + +- (IBAction)commitAction:(id)sender { + [UIView animateWithDuration:0.3 animations:^{ + self.bgView.alpha = 0; + }completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; +} +@end diff --git a/QXLive/Mine(音域)/View/QXBodyPriceRuleView.xib b/QXLive/Mine(音域)/View/QXBodyPriceRuleView.xib new file mode 100644 index 0000000..6e4fac8 --- /dev/null +++ b/QXLive/Mine(音域)/View/QXBodyPriceRuleView.xib @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QXLive/Mine(音域)/View/QXMainHeaderView.h b/QXLive/Mine(音域)/View/QXMainHeaderView.h index 3bac0c8..657c114 100644 --- a/QXLive/Mine(音域)/View/QXMainHeaderView.h +++ b/QXLive/Mine(音域)/View/QXMainHeaderView.h @@ -45,6 +45,8 @@ typedef NS_ENUM(NSInteger) { QXMainHeaderOptionTypeWallet = 35, /// 礼物墙 QXMainHeaderOptionTypeGiftWall = 36, + /// 身价 + QXMainHeaderOptionTypeBodyPrice = 37, }QXMainHeaderOptionType; @protocol QXMainHeaderViewDelegate diff --git a/QXLive/Mine(音域)/View/QXMainHeaderView.m b/QXLive/Mine(音域)/View/QXMainHeaderView.m index 6f50a9b..b7ab8d6 100644 --- a/QXLive/Mine(音域)/View/QXMainHeaderView.m +++ b/QXLive/Mine(音域)/View/QXMainHeaderView.m @@ -56,6 +56,11 @@ @property (nonatomic, strong)UILabel *walletMoneyLabel; @property (nonatomic, strong)UIButton *walletBtn; +@property (nonatomic, strong)UIImageView *bodyPriceBgImageView; +@property (nonatomic, strong)UILabel *bodyPriceBottomLabel; +@property (nonatomic, strong)UILabel *bodyPriceMoneyLabel; +@property (nonatomic, strong)UIButton *bodyPriceBtn; + @property (nonatomic, strong)UIImageView *giftWallBgImageView; @property (nonatomic, strong)UILabel *giftWallTitleLabel; @property (nonatomic, strong)UIButton *giftWallBtn; @@ -240,7 +245,7 @@ self.walletTitleLabel.textColor = RGB16(0x929196); [self.walletBgView addSubview:self.walletTitleLabel]; - CGFloat walletWidth = (self.topBgView.width - 16*3) / 2; + CGFloat walletWidth = (self.topBgView.width - 16*4) / 3; self.walletBgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.topBgView.left, self.walletTitleLabel.bottom+8, walletWidth, 60)]; self.walletBgImageView.backgroundColor = RGB16(0xFFE38E); [self.walletBgImageView addRoundedCornersWithRadius:8]; @@ -254,15 +259,35 @@ [self.walletBgView addSubview:self.walletBottomLabel]; - self.walletMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.walletBgImageView.left, self.walletBgImageView.top+11, walletWidth, 25)]; + self.walletMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.walletBgImageView.left, self.walletBgImageView.top+11, walletWidth, 27)]; self.walletMoneyLabel.text = @"0"; self.walletMoneyLabel.textAlignment = NSTextAlignmentCenter; self.walletMoneyLabel.font = [UIFont fontWithName:@"DIN Condensed" size:25]; self.walletMoneyLabel.textColor = RGB16(0x222222); [self.walletBgView addSubview:self.walletMoneyLabel]; + self.bodyPriceBgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.walletBgImageView.right+16, self.walletBgImageView.top, walletWidth, self.walletBgImageView.height)]; + self.bodyPriceBgImageView.backgroundColor = RGB16(0xFFB68F); + [self.bodyPriceBgImageView addRoundedCornersWithRadius:8]; + [self.walletBgView addSubview:self.bodyPriceBgImageView]; - self.giftWallBgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.walletBgImageView.right+16, self.walletBgImageView.top, walletWidth, self.walletBgImageView.height)]; + self.bodyPriceBottomLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.bodyPriceBgImageView.left, self.bodyPriceBgImageView.bottom-14-11, walletWidth, 14)]; + self.bodyPriceBottomLabel.text = @"身价"; + self.bodyPriceBottomLabel.textAlignment = NSTextAlignmentCenter; + self.bodyPriceBottomLabel.font = [UIFont systemFontOfSize:12]; + self.bodyPriceBottomLabel.textColor = RGB16(0x333333); + [self.walletBgView addSubview:self.bodyPriceBottomLabel]; + + + self.bodyPriceMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.bodyPriceBgImageView.left, self.walletBgImageView.top+11, walletWidth, 27)]; + self.bodyPriceMoneyLabel.text = @"1"; + self.bodyPriceMoneyLabel.textAlignment = NSTextAlignmentCenter; + self.bodyPriceMoneyLabel.font = [UIFont fontWithName:@"DIN Condensed" size:25]; + self.bodyPriceMoneyLabel.textColor = RGB16(0x222222); + [self.walletBgView addSubview:self.bodyPriceMoneyLabel]; + + + self.giftWallBgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.bodyPriceBgImageView.right+16, self.walletBgImageView.top, walletWidth, self.walletBgImageView.height)]; self.giftWallBgImageView.backgroundColor = RGB16(0xF1B3FF); [self.giftWallBgImageView addRoundedCornersWithRadius:8]; [self.walletBgView addSubview:self.giftWallBgImageView]; @@ -281,6 +306,10 @@ self.giftWallBtn = [[UIButton alloc] initWithFrame:self.giftWallBgImageView.frame]; [self.giftWallBtn addTarget:self action:@selector(giftWalltAction) forControlEvents:(UIControlEventTouchUpInside)]; [self.walletBgView addSubview:self.giftWallBtn]; + + self.bodyPriceBtn = [[UIButton alloc] initWithFrame:self.bodyPriceBgImageView.frame]; + [self.bodyPriceBtn addTarget:self action:@selector(bodyPriceAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.walletBgView addSubview:self.bodyPriceBtn]; } -(CGFloat)getHeight{ return self.walletBgView.bottom+6; @@ -359,6 +388,12 @@ } } +-(void)bodyPriceAction{ + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickOptionType:)]) { + [self.delegate didClickOptionType:QXMainHeaderOptionTypeBodyPrice]; + } +} + -(void)gotoUserHomePageClick{ if (self.delegate && [self.delegate respondsToSelector:@selector(didClickOptionType:)]) { @@ -367,6 +402,7 @@ } -(void)setUserModel:(QXUserModel *)userModel{ _userModel = userModel; + self.nameLabel.text = userModel.market_value; [self.userHeaderView setHeadIcon:userModel.avatar dress:userModel.dress]; [self.userHeaderView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:userModel.nobility_image]]; if ([userModel.nickname_color isExist]) { diff --git a/QXLive/Mine(音域)/View/QXMineServiceCell.h b/QXLive/Mine(音域)/View/QXMineServiceCell.h index 936c7b7..d81357b 100644 --- a/QXLive/Mine(音域)/View/QXMineServiceCell.h +++ b/QXLive/Mine(音域)/View/QXMineServiceCell.h @@ -17,6 +17,8 @@ typedef NS_ENUM(NSInteger) { QXMineServiceTypeBackpack = 42, /// 设置 QXMineServiceTypeSetting = 43, + /// 家族 + QXMineServiceTypeFamily = 80, /// 帮助中心 QXMineServiceTypeHelp = 44, /// 邀请 diff --git a/QXLive/Mine(音域)/View/QXMineServiceCell.m b/QXLive/Mine(音域)/View/QXMineServiceCell.m index a28020b..557ed6b 100644 --- a/QXLive/Mine(音域)/View/QXMineServiceCell.m +++ b/QXLive/Mine(音域)/View/QXMineServiceCell.m @@ -165,12 +165,17 @@ md4.icon = @"service_setting"; md4.type = QXMineServiceTypeSetting; + QXServiceModel *md5 = [[QXServiceModel alloc] init]; + md5.title = @"家族"; + md5.icon = @"service_setting"; + md5.type = QXMineServiceTypeFamily; _serviceArray = [NSMutableArray arrayWithArray:@[ md1, md2, md3, md4, + md5 ]]; } return _serviceArray; diff --git a/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.h b/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.h index 0ecdb75..8176570 100644 --- a/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.h +++ b/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.h @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface QXUserHomeHeaderView : UIView @property (nonatomic,strong)QXUserHomeModel *model; @property (nonatomic,strong)NSString *userId; +-(void)headerStartPlay; @end @interface QXTagImageCell : UICollectionViewCell diff --git a/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.m b/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.m index e11763e..5a5bafa 100644 --- a/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.m +++ b/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.m @@ -17,8 +17,10 @@ #import "QXUserCpCardView.h" #import "QXGiftWallViewController.h" #import "QXHeartBeatSpaceViewController.h" +#import "QXUserHomePageViewController.h" +#import "QXHeartBeatSpaceViewController.h" -@interface QXUserHomeHeaderView() +@interface QXUserHomeHeaderView() //@property (nonatomic,strong) CKShimmerLabel * tempName; @property (nonatomic,strong) QXSeatHeaderView* headerView; @property (nonatomic,strong) UIView * whiteBgView; @@ -57,8 +59,6 @@ self.backgroundColor = [UIColor clearColor]; self.headerView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake(32, 26, 70, 84)]; - - [self.headerView addRoundedCornersWithRadius:35]; [self addSubview:self.headerView]; [self.headerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(32); @@ -264,6 +264,7 @@ [self.whiteBgView addSubview:self.cpDressView]; self.cpCardView = [[QXUserCpCardView alloc] init]; + self.cpCardView.delegate = self; self.cpCardView.hidden = YES; MJWeakSelf [self.cpCardView addTapBlock:^(id _Nonnull obj) { @@ -289,8 +290,15 @@ make.height.mas_equalTo(ScaleWidth(40)); make.top.equalTo(self.cpCardView.mas_bottom).offset(8); }]; + [self.whiteBgView bringSubviewToFront:self.playBtn]; + [self bringSubviewToFront:self.followBtn]; + +} +-(void)headerStartPlay{ + [self.headerView playHWDMP4]; + [self.cpCardView headerStartPlay]; + [self.cpDressView headerStartPlay]; } - -(void)giftWallAction{ QXGiftWallViewController *vc = [[QXGiftWallViewController alloc] init]; vc.userId = self.userId; @@ -314,6 +322,21 @@ [[QXGlobal shareGlobal] chatWithUserID:self.model.user_id nickname:self.model.nickname avatar:self.model.avatar navagationController:self.navigationController]; } } +-(void)didClickHeaderViewUserId:(NSString*)userId{ + if ([userId isEqualToString:self.userId]) { + return; + } + QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init]; + vc.user_id = userId; + [self.viewController.navigationController pushViewController:vc animated:YES]; +} + +-(void)didClickHeaderCardViewWithUserId:(NSString*)userId{ + QXHeartBeatSpaceViewController *vc = [[QXHeartBeatSpaceViewController alloc] init]; + vc.userId = userId; + [self.viewController.navigationController pushViewController:vc animated:YES]; +} + -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ if (collectionView == self.collectionView) { @@ -335,6 +358,10 @@ } } +-(void)setUserId:(NSString *)userId{ + _userId = userId; + self.cpCardView.userId = self.userId; +} -(void)setModel:(QXUserHomeModel *)model{ _model = model; // model.nickname = @"大家好撒客户端撒大厦尽快"; diff --git a/QXLive/Mine(音域)/View/个性装扮/QXDressCell.m b/QXLive/Mine(音域)/View/个性装扮/QXDressCell.m index 889ef98..b1c753c 100644 --- a/QXLive/Mine(音域)/View/个性装扮/QXDressCell.m +++ b/QXLive/Mine(音域)/View/个性装扮/QXDressCell.m @@ -19,7 +19,11 @@ _model = model; self.nameLabel.text = model.title; [self.dressImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]]; - self.timeLabel.text = [NSString stringWithFormat:@"%@%@",model.remaining_day,QXText(@"天")]; + if ([model.type isEqualToString:@"12"]) { + self.timeLabel.text = [NSString stringWithFormat:@"x%@",model.num]; + }else{ + self.timeLabel.text = [NSString stringWithFormat:@"%@%@",model.remaining_day,QXText(@"天")]; + } // if (model.is_using.intValue == 1) { // self.selecteBtn.selected = NO; // }else{ diff --git a/QXLive/Mine(音域)/View/个性装扮/QXDressCell.xib b/QXLive/Mine(音域)/View/个性装扮/QXDressCell.xib index c946303..f65183d 100644 --- a/QXLive/Mine(音域)/View/个性装扮/QXDressCell.xib +++ b/QXLive/Mine(音域)/View/个性装扮/QXDressCell.xib @@ -11,21 +11,21 @@ - + - + - + - + @@ -58,9 +58,9 @@ - + - + - + diff --git a/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.h b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.h new file mode 100644 index 0000000..30fec15 --- /dev/null +++ b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.h @@ -0,0 +1,17 @@ +// +// QXHeartBeatLevelRuleView.h +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface QXHeartBeatLevelRuleView : UIView +@property (nonatomic,strong)NSString*rule; +-(void)showInView:(UIView *)view; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.m b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.m new file mode 100644 index 0000000..49dc9fd --- /dev/null +++ b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatLevelRuleView.m @@ -0,0 +1,123 @@ +// +// QXHeartBeatLevelRuleView.m +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import "QXHeartBeatLevelRuleView.h" +#import +@interface QXHeartBeatLevelRuleView() +@property(nonatomic,strong)WKWebView *contentWebView; +@property(nonatomic,strong)UIView* bgView; +@property(nonatomic,strong)UIButton* closeBtn; +@end +@implementation QXHeartBeatLevelRuleView + + +- (instancetype)init +{ + self = [super init]; + if (self) { + self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + [self initSubviews]; + } + return self; +} +-(void)initSubviews{ + self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3]; + + self.bgView = [[UIView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(312))/2, (self.height-ScaleWidth(492))/2-40, ScaleWidth(312), ScaleWidth(492))]; + [self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)]; + [self addSubview:self.bgView]; + + [self.bgView addSubview:self.contentWebView]; + self.closeBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width-40)/2, self.bgView.bottom+10, 40, 40)]; + [self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)]; + [self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self addSubview:self.closeBtn]; + [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(40); + make.centerX.equalTo(self); + make.top.mas_equalTo(self.bgView.bottom+10); + }]; +} + + +-(void)setRule:(NSString *)rule{ + _rule = rule; + [self loadData]; +} +- (void)loadData { + NSURL* url=[NSURL URLWithString:self.rule]; + NSURLRequest *request =[NSURLRequest requestWithURL:url]; + [self.contentWebView loadRequest:request]; +} + + +-(void)closeAction{ + [self hide]; +} + +#pragma mark - getters and setters +- (WKWebView *)contentWebView { + if (!_contentWebView) { + //设置网页的配置文件 + WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init]; + // 允许可以与网页交互,选择视图 + configuration.selectionGranularity = YES; + // web内容处理池pr + configuration.processPool = [[WKProcessPool alloc] init]; + //自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作) + WKUserContentController * UserContentController = [[WKUserContentController alloc]init]; + // 是否支持记忆读取 + configuration.suppressesIncrementalRendering = NO; + // 允许用户更改网页的设置 + configuration.preferences.javaScriptEnabled = YES; + configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES; + configuration.userContentController = UserContentController; + // 此处一定要做判断,因为是iOS9之后才有的方法,否则在iOS8下会崩溃 + if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) { + //允许视频播放 + configuration.allowsAirPlayForMediaPlayback = YES; + // 允许在线播放 + configuration.allowsInlineMediaPlayback = YES; + //开启手势触摸 默认设置就是NO。在ios8系统中会导致手势问题,程序崩溃 + _contentWebView.allowsBackForwardNavigationGestures = YES; + } + _contentWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, self.bgView.height) configuration:configuration]; + _contentWebView.backgroundColor = UIColor.clearColor; + [_contentWebView addRoundedCornersWithRadius:6]; + _contentWebView.opaque = NO; + //适应你设定的尺寸 + [_contentWebView sizeToFit]; + _contentWebView.scrollView.showsVerticalScrollIndicator = NO; + _contentWebView.scrollView.backgroundColor = [UIColor clearColor]; + _contentWebView.scrollView.bounces = NO; + // 设置代理 + } + return _contentWebView; +} + + + +-(void)showInView:(UIView *)view{ + self.bgView.y = -SCREEN_HEIGHT; + [view addSubview:self]; + [UIView animateWithDuration:0.3 animations:^{ + self.bgView.y = (self.height-ScaleWidth(492))/2-40; + } completion:^(BOOL finished) { + self.closeBtn.hidden = NO; + }]; +} +-(void)hide{ + self.closeBtn.hidden = YES; + [UIView animateWithDuration:0.3 animations:^{ + self.bgView.y = SCREEN_HEIGHT; + } completion:^(BOOL finished) { + + [self removeFromSuperview]; + }]; +} + +@end diff --git a/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.h b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.h new file mode 100644 index 0000000..f318e2d --- /dev/null +++ b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.h @@ -0,0 +1,22 @@ +// +// QXHeartBeatSpaceRecordCell.h +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface QXHeartBeatSpaceRecordCell : UITableViewCell +@property (weak, nonatomic) IBOutlet QXSeatHeaderView *headerView; +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *timeLabel; +@property (weak, nonatomic) IBOutlet UILabel *contentLabel; +@property (strong, nonatomic)QXUserHeartBeatSpaceLogModel *model; +@property (strong, nonatomic)NSString *userId; ++(instancetype)cellWithTableView:(UITableView *)tableView; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.m b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.m new file mode 100644 index 0000000..e35476c --- /dev/null +++ b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.m @@ -0,0 +1,59 @@ +// +// QXHeartBeatSpaceRecordCell.m +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import "QXHeartBeatSpaceRecordCell.h" + +@implementation QXHeartBeatSpaceRecordCell ++(instancetype)cellWithTableView:(UITableView *)tableView{ + static NSString *cellId = @"QXHeartBeatSpaceRecordCell"; + QXHeartBeatSpaceRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; + if (!cell) { + cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject; + cell.backgroundColor = [UIColor clearColor]; + cell.contentView.backgroundColor = [UIColor clearColor]; + } + return cell; +} +-(void)setUserId:(NSString *)userId{ + _userId = userId; +} + +-(void)setModel:(QXUserHeartBeatSpaceLogModel *)model{ + _model = model; + [self.headerView setHeadIcon:model.from_user_info.avatar dress:model.from_user_info.dress]; + NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000 + NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; + formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; + NSString*time = [formatter stringFromDate:date]; + self.timeLabel.text = time; + self.nameLabel.text = model.from_user_info.nickname; + UIColor *nameColor = RGB16(0xFF53CC); + UIColor *contentNameColor = RGB16(0x4A89FF); + NSString *content = [NSString stringWithFormat:@"%@",model.remark]; + NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:content]; + + if ([model.from_user_id isEqualToString:self.userId] ) { + self.nameLabel.textColor = nameColor; + [attr yy_setColor:contentNameColor range:[content rangeOfString:model.to_user_info.nickname]]; + }else{ + self.nameLabel.textColor = contentNameColor; + [attr yy_setColor:nameColor range:[content rangeOfString:model.to_user_info.nickname]]; + } + self.contentLabel.attributedText = attr; +} +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.xib b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.xib new file mode 100644 index 0000000..1b9c8e4 --- /dev/null +++ b/QXLive/Mine(音域)/View/亲密关系/QXHeartBeatSpaceRecordCell.xib @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateContentView.m b/QXLive/Mine(音域)/View/亲密关系/QXIntimateContentView.m index 4313f01..36145ec 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateContentView.m +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateContentView.m @@ -119,6 +119,7 @@ -(void)setUserId:(NSString *)userId{ _userId = userId; + self.cpCardView.userId = userId; self.page = 1; [self getList]; } @@ -159,6 +160,7 @@ QXMoreIntimateViewController *vc = [[QXMoreIntimateViewController alloc] init]; vc.userId = self.userId; vc.relation_id = md.relation_list.firstObject.relation_id; + vc.relation_name = md.relation_name; [self.viewController.navigationController pushViewController:vc animated:YES]; } @@ -175,11 +177,13 @@ if (md.relation_list.count > 1) { QXIntimateListCell*cell = [QXIntimateListCell cellWithTableView:tableView]; QXRoomBestFriendListModel *md = self.dataArray[indexPath.section]; + cell.userId = self.userId; cell.model = md; return cell; }else{ MJWeakSelf QXIntimateMoreListCell *cell = [QXIntimateMoreListCell cellWithTableView:tableView]; + cell.userId = self.userId; cell.model = md.relation_list.firstObject; cell.deleteSuccessBlock = ^(QXRelationshipListModel * _Nonnull model) { weakSelf.page = 1; @@ -235,7 +239,7 @@ -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ QXRoomBestFriendListModel *md = self.dataArray[indexPath.section]; - if (md.relation_list.count > 1) { + if (md.relation_list.count == 1) { return ScaleWidth(92)+18; }else{ if (md.relation_list.count == 0) { diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.h b/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.h index 17136e9..bdf5837 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.h +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.h @@ -6,11 +6,13 @@ // #import - +#import "QXUserCpCardView.h" NS_ASSUME_NONNULL_BEGIN @interface QXIntimateCpCell : UITableViewCell @property (nonatomic,strong)QXUserCpInfoModel *model; +@property (nonatomic,strong)NSString *userId; +@property (nonatomic,weak)iddelegate; +(instancetype)cellWithTableView:(UITableView *)tableView; @end diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.m b/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.m index af66643..4a7ef0d 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.m +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.m @@ -6,8 +6,8 @@ // #import "QXIntimateCpCell.h" -#import "QXUserCpCardView.h" -@interface QXIntimateCpCell() + +@interface QXIntimateCpCell() @property (nonatomic,strong)QXUserCpCardView *cardView; @end @implementation QXIntimateCpCell @@ -34,9 +34,13 @@ _model = model; self.cardView.model = model; } - +-(void)setUserId:(NSString *)userId{ + _userId = userId; + self.cardView.userId = self.userId; +} -(void)initSubviews{ self.cardView = [[QXUserCpCardView alloc] init]; + self.cardView.delegate = self; [self.contentView addSubview:self.cardView]; [self.cardView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(24); @@ -44,6 +48,17 @@ make.top.bottom.equalTo(self.contentView); }]; } + +-(void)didClickHeaderCardViewWithUserId:(NSString *)userId{ + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderCardViewWithUserId:)]) { + [self.delegate didClickHeaderCardViewWithUserId:userId]; + } +} +-(void)didClickHeaderViewUserId:(NSString *)userId{ + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderViewUserId:)]) { + [self.delegate didClickHeaderViewUserId:userId]; + } +} - (void)awakeFromNib { [super awakeFromNib]; // Initialization code diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.h b/QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.h index 2a6f2c3..d3efeb4 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.h +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @interface QXIntimateListCell : UITableViewCell @property (nonatomic,strong)QXRoomBestFriendListModel *model; +@property (nonatomic,strong)NSString *userId; +(instancetype)cellWithTableView:(UITableView *)tableView; @end diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.m b/QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.m index 2b25cf6..21dc2c3 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.m +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.m @@ -7,7 +7,7 @@ #import "QXIntimateListCell.h" #import "QXIntimateUserCell.h" - +#import "QXUserHomePageViewController.h" @interface QXIntimateListCell() @property (nonatomic,strong)UICollectionView *collectionView; @end @@ -68,9 +68,22 @@ } -(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ QXIntimateUserCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXIntimateUserCell" forIndexPath:indexPath]; + cell.userId = self.userId; cell.model = self.model.relation_list[indexPath.row]; return cell; } +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ + QXRelationshipListModel *md = self.model.relation_list[indexPath.row]; + NSString *userId = @""; + if ([md.user_id1 isEqualToString:self.userId]) { + userId = md.user_id2; + }else{ + userId = md.user_id1; + } + QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init]; + vc.user_id = userId; + [self.viewController.navigationController pushViewController:vc animated:YES]; +} - (void)awakeFromNib { [super awakeFromNib]; // Initialization code diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.h b/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.h index bfd71ef..ed1a38b 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.h +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.h @@ -8,7 +8,12 @@ #import NS_ASSUME_NONNULL_BEGIN +@protocol QXIntimateMoreListCellDelegate +@optional +-(void)didClickHeaderWithUserId:(NSString*)userId; + +@end @interface QXIntimateMoreListCell : UITableViewCell @property (weak, nonatomic) IBOutlet QXSeatHeaderView *leftHeaderView; @property (weak, nonatomic) IBOutlet UIImageView *leftSexImageView; @@ -18,8 +23,10 @@ NS_ASSUME_NONNULL_BEGIN @property (weak, nonatomic) IBOutlet UILabel *rightNameLabel; @property (weak, nonatomic) IBOutlet UILabel *timeLabel; @property (nonatomic,strong)QXRelationshipListModel *model; +@property (nonatomic,strong)NSString *userId; @property (nonatomic,copy)void(^topSuccessBlock)(QXRelationshipListModel*model); @property (nonatomic,copy)void(^deleteSuccessBlock)(QXRelationshipListModel*model); +@property (nonatomic,weak)iddelegate; +(instancetype)cellWithTableView:(UITableView *)tableView; @end diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.m b/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.m index b5a9c10..bb8f291 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.m +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.m @@ -67,25 +67,41 @@ }]; } +- (IBAction)leftAction:(id)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderWithUserId:)]) { + [self.delegate didClickHeaderWithUserId:self.userId]; + } +} +- (IBAction)rightAction:(id)sender { + NSString *userId = @""; + if ([self.model.user_id1 isEqualToString:self.userId]) { + userId = self.model.user_id2; + }else{ + userId = self.model.user_id1; + } + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderWithUserId:)]) { + [self.delegate didClickHeaderWithUserId:userId]; + } +} -(void)setModel:(QXRelationshipListModel *)model{ _model = model; - if ([model.user_id1 isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) { - [self.leftHeaderView setHeadIcon:model.avatar2 dress:@""]; - self.leftNameLabel.text = model.nickname2; - self.leftSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"]; - [self.rightHeaderView setHeadIcon:model.avatar1 dress:@""]; - self.rightNameLabel.text = model.nickname1; - self.rightSexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"]; - }else{ + if ([model.user_id1 isEqualToString:self.userId]) { [self.leftHeaderView setHeadIcon:model.avatar1 dress:@""]; self.leftNameLabel.text = model.nickname1; self.leftSexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"]; [self.rightHeaderView setHeadIcon:model.avatar2 dress:@""]; self.rightNameLabel.text = model.nickname2; self.rightSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"]; + }else{ + [self.leftHeaderView setHeadIcon:model.avatar2 dress:@""]; + self.leftNameLabel.text = model.nickname2; + self.leftSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"]; + [self.rightHeaderView setHeadIcon:model.avatar1 dress:@""]; + self.rightNameLabel.text = model.nickname1; + self.rightSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"]; } NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970]; long long milliseconds = (long long)(currentTime); diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.xib b/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.xib index 0f6f27d..ed7560b 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.xib +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.xib @@ -30,6 +30,19 @@ + + @@ -70,35 +83,44 @@ - + + + + + + + + + diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.h b/QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.h index 5990164..751693b 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.h +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.h @@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN @property (weak, nonatomic) IBOutlet UILabel *nameLabel; @property (weak, nonatomic) IBOutlet QXSeatHeaderView *headerView; @property (weak, nonatomic) IBOutlet UIImageView *sexImageView; +@property (nonatomic,strong)NSString* userId; @property (nonatomic,strong)QXRelationshipListModel *model; @end diff --git a/QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.m b/QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.m index fd95db2..66490d1 100644 --- a/QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.m +++ b/QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.m @@ -10,7 +10,7 @@ @implementation QXIntimateUserCell -(void)setModel:(QXRelationshipListModel *)model{ _model = model; - if ([model.user_id1 isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) { + if ([model.user_id1 isEqualToString:self.userId]) { [self.headerView setHeadIcon:model.avatar2 dress:@""]; self.nameLabel.text = model.nickname2; self.sexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"]; @@ -19,9 +19,15 @@ self.nameLabel.text = model.nickname1; self.sexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"]; } - self.timeLabel.text = [NSString getTimeWithSecond:model.end_time.longLongValue]; + NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970]; + long long milliseconds = (long long)(currentTime); + NSInteger time = model.end_time.longLongValue - milliseconds; + self.timeLabel.text = [NSString stringWithFormat:@" %@ ",[NSString getTimeWithSecond:time]]; } +-(void)setUserId:(NSString *)userId{ + _userId = userId; +} - (void)awakeFromNib { [super awakeFromNib]; // Initialization code diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.h b/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.h new file mode 100644 index 0000000..68e7aa7 --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.h @@ -0,0 +1,29 @@ +// +// QXFamilyMemberCell.h +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import +#import "QXFamilyModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXFamilyMemberCell : UITableViewCell +@property (weak, nonatomic) IBOutlet QXSeatHeaderView *headerView; +@property (weak, nonatomic) IBOutlet UICollectionView *collectionView; +@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *flowLayout; +@property (weak, nonatomic) IBOutlet UILabel *dayLabel; +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *timesLabel; +@property (weak, nonatomic) IBOutlet UIButton *priceBtn; +@property (weak, nonatomic) IBOutlet UILabel *onlineLabel; +@property (weak, nonatomic) IBOutlet UIButton *todayPriceBtn; +@property (weak, nonatomic) IBOutlet UIButton *yestodayPriceBtn; +@property (weak, nonatomic) IBOutlet UIButton *continueBtn; +@property (strong, nonatomic) QXFamilyMemberModel *model; ++(instancetype)cellWithTableView:(UITableView *)tableView; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.m b/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.m new file mode 100644 index 0000000..8aafcbb --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.m @@ -0,0 +1,82 @@ +// +// QXFamilyMemberCell.m +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXFamilyMemberCell.h" +#import "QXUserHomeHeaderView.h" +#import "QXCustomAlertView.h" +@interface QXFamilyMemberCell() +@end +@implementation QXFamilyMemberCell ++(instancetype)cellWithTableView:(UITableView *)tableView{ + static NSString *cellId = @"QXFamilyMemberCell"; + QXFamilyMemberCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; + if (!cell) { + cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject; + cell.flowLayout.itemSize = CGSizeMake(UserIconWidth, UserIconHeight); + cell.flowLayout.minimumLineSpacing = 7; + cell.flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + cell.collectionView.dataSource = cell; + cell.collectionView.delegate = cell; + cell.collectionView.backgroundColor = UIColor.clearColor; + [cell.collectionView registerClass:[QXTagImageCell class] forCellWithReuseIdentifier:@"QXTagImageCell"]; + cell.backgroundColor = [UIColor clearColor]; + cell.contentView.backgroundColor = [UIColor clearColor]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + } + return cell; +} +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} +-(void)setModel:(QXFamilyMemberModel *)model{ + _model = model; + [self.headerView setHeadIcon:model.nickname dress:model.dress]; + [self.headerView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:model.nobility_image]]; + self.dayLabel.text = [NSString stringWithFormat:@"剩余租期:%@",model.end_day]; + self.timesLabel.text = [NSString stringWithFormat:@"免费续约次数:%@",model.free_renewal]; + self.nameLabel.text = model.nickname; + [self.todayPriceBtn setTitle:model.today_earnings forState:(UIControlStateNormal)]; + [self.yestodayPriceBtn setTitle:model.yesterday_earnings forState:(UIControlStateNormal)]; + [self.priceBtn setTitle:model.market_value forState:(UIControlStateNormal)]; + self.onlineLabel.text = model.is_online==1?@"当前在线":@"当前离线"; + self.continueBtn.hidden = model.is_show_sign.intValue==1?NO:YES; +} +- (IBAction)continueAction:(id)sender { + QXCustomAlertView *al = [[QXCustomAlertView alloc] init]; + al.title = @"续约提示"; + al.message = @"尊敬的用户:  您的徒弟【夏沫】当前为首次签约的 免费续约期。续约后,徒弟合约将延长7天,您剩余的免费续约次数:1次"; + al.cancleTitle = @"取消"; + al.commitTitle = @"确认续约"; + al.isFromController = YES; + al.cancelBlock = ^{ + [[QXGlobal shareGlobal] hideViewBlock:nil]; + }; + al.commitBlock = ^{ + [[QXGlobal shareGlobal] hideViewBlock:nil]; + }; + [QXGlobal.shareGlobal showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:nil]; +// [al showInView:self.viewController.view title:@"续约提示" message:@"尊敬的用户:  您的徒弟【夏沫】当前为首次签约的 免费续约期。续约后,徒弟合约将延长7天,您剩余的免费续约次数:1次" cancleTitle:@"取消" commitTitle:@"确认续约"]; +} +-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + if (self.model==nil) { + return 0; + } + return self.model.icon.count; +} +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + QXTagImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXTagImageCell" forIndexPath:indexPath]; + cell.imageUrl = self.model.icon[indexPath.row]; + return cell; +} +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.xib b/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.xib new file mode 100644 index 0000000..ee6ec03 --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyMemberCell.xib @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.h b/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.h new file mode 100644 index 0000000..1e40516 --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.h @@ -0,0 +1,22 @@ +// +// QXFamilyPriceRecordCell.h +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import +#import "QXFamilyModel.h" +NS_ASSUME_NONNULL_BEGIN + +@interface QXFamilyPriceRecordCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *giftLabel; +@property (weak, nonatomic) IBOutlet UILabel *giftPriceLabel; +@property (weak, nonatomic) IBOutlet UILabel *timeLabel; +@property (weak, nonatomic) IBOutlet UILabel *moneyLabel; +@property (strong, nonatomic) QXFamilyEarningModel *model; ++(instancetype)cellWithTableView:(UITableView *)tableView; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.m b/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.m new file mode 100644 index 0000000..c940acf --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.m @@ -0,0 +1,45 @@ +// +// QXFamilyPriceRecordCell.m +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXFamilyPriceRecordCell.h" + +@implementation QXFamilyPriceRecordCell ++(instancetype)cellWithTableView:(UITableView *)tableView{ + static NSString *cellId = @"QXFamilyPriceRecordCell"; + QXFamilyPriceRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; + if (!cell) { + cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject; + cell.backgroundColor = [UIColor clearColor]; + cell.contentView.backgroundColor = [UIColor clearColor]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + } + return cell; +} +-(void)setModel:(QXFamilyEarningModel *)model{ + _model = model; + self.nameLabel.text = model.nickname; + self.giftLabel.text = [NSString stringWithFormat:@"礼物名称:%@",model.gift_name]; + self.giftPriceLabel.text = [NSString stringWithFormat:@"礼物金额:%@",model.gift_price]; + NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000 + NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; + formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; + NSString*time = [formatter stringFromDate:date]; + self.timeLabel.text = time; + self.moneyLabel.text = [NSString stringWithFormat:@"+%@",model.earnings]; +} +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.xib b/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.xib new file mode 100644 index 0000000..d5e9901 --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyPriceRecordCell.xib @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.h b/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.h new file mode 100644 index 0000000..9c0ed72 --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.h @@ -0,0 +1,22 @@ +// +// QXFamilyTopCell.h +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import +#import "QXFamilyModel.h" +NS_ASSUME_NONNULL_BEGIN + +@interface QXFamilyTopCell : UITableViewCell +@property (weak, nonatomic) IBOutlet QXSeatHeaderView *headerView; +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *IdLabel; +@property (weak, nonatomic) IBOutlet UILabel *priceLabel; +@property (weak, nonatomic) IBOutlet UIButton *timesBtn; +@property (strong, nonatomic) QXFamilyModel *model; ++(instancetype)cellWithTableView:(UITableView *)tableView; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.m b/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.m new file mode 100644 index 0000000..c7a9f4c --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.m @@ -0,0 +1,55 @@ +// +// QXFamilyTopCell.m +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXFamilyTopCell.h" +#import "QXFamilyPriceRecordViewController.h" + +@implementation QXFamilyTopCell ++(instancetype)cellWithTableView:(UITableView *)tableView{ + static NSString *cellId = @"QXFamilyTopCell"; + QXFamilyTopCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; + if (!cell) { + cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject; + cell.backgroundColor = [UIColor clearColor]; + cell.contentView.backgroundColor = [UIColor clearColor]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + } + return cell; +} +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} +- (IBAction)familyGroupAction:(id)sender { + if (self.model.group_members_lists.count == 0) { + showToast(@"家族群至少需要签约一位徒弟"); + }else{ + [[QXGlobal shareGlobal] chatWithGroupId:self.model.group_id cover:self.model.group_owner_info.avatar name:[NSString stringWithFormat:@"%@的家族",self.model.group_owner_info.nickname] navagationController:self.viewController.navigationController]; + } +} + +-(void)setModel:(QXFamilyModel *)model{ + _model = model; + [self.headerView setHeadIcon:model.group_owner_info.avatar dress:model.group_owner_info.dress]; + [self.headerView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:model.group_owner_info.nobility_image]]; + self.nameLabel.text = model.group_owner_info.nickname; + self.IdLabel.text = [NSString stringWithFormat:@"ID:%@",model.group_owner_info.user_code]; + self.priceLabel.text = model.group_earnings; + [self.timesBtn setTitle:[NSString stringWithFormat:@"签约次数:%@",model.group_members_num] forState:(UIControlStateNormal)]; +} +- (IBAction)moreAction:(id)sender { + QXFamilyPriceRecordViewController *vc = [[QXFamilyPriceRecordViewController alloc] init]; + [self.viewController.navigationController pushViewController:vc animated:YES]; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.xib b/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.xib new file mode 100644 index 0000000..9d23ac5 --- /dev/null +++ b/QXLive/Mine(音域)/View/家族/QXFamilyTopCell.xib @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m index ca37fb9..b5acc8c 100644 --- a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m +++ b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m @@ -21,7 +21,12 @@ -(void)setModel:(QXDayTaskListModel *)model{ _model = model; self.titleLabel.text = model.task_name; - NSString*subTitle = [NSString stringWithFormat:@"金币+%@",model.gold_reward]; + NSString*subTitle = @""; + if (model.reward_type.intValue == 1) { + subTitle = [NSString stringWithFormat:@"金币+%@",model.gold_reward]; + }else{ + subTitle = [NSString stringWithFormat:@"钻石+%@",model.gold_reward]; + } NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:subTitle]; [attr yy_setColor:RGB16(0xFF8827) range:[subTitle rangeOfString:[NSString stringWithFormat:@"+%@",model.gold_reward]]]; self.subTitleLabel.attributedText = attr; diff --git a/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/Contents.json new file mode 100644 index 0000000..ba1895e --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "body_price_rule_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "body_price_rule_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/body_price_rule_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/body_price_rule_bg@2x.png new file mode 100644 index 0000000..2f2d006 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/body_price_rule_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/body_price_rule_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/body_price_rule_bg@3x.png new file mode 100644 index 0000000..4fe7f11 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/body_price_rule_bg.imageset/body_price_rule_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/Contents.json new file mode 100644 index 0000000..9d06e35 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "heart_beat_space_dress_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "heart_beat_space_dress_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/heart_beat_space_dress_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/heart_beat_space_dress_bg@2x.png new file mode 100644 index 0000000..e3e5bf2 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/heart_beat_space_dress_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/heart_beat_space_dress_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/heart_beat_space_dress_bg@3x.png new file mode 100644 index 0000000..5e7b2fd Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/heart_beat_space_dress_bg.imageset/heart_beat_space_dress_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/Contents.json new file mode 100644 index 0000000..ac5cc78 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "user_heart_beat_exp_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "user_heart_beat_exp_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/user_heart_beat_exp_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/user_heart_beat_exp_bg@2x.png new file mode 100644 index 0000000..0b5b5e5 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/user_heart_beat_exp_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/user_heart_beat_exp_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/user_heart_beat_exp_bg@3x.png new file mode 100644 index 0000000..85840f0 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_exp_bg.imageset/user_heart_beat_exp_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/Contents.json new file mode 100644 index 0000000..7b31b3c --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "user_heart_beat_fly@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "user_heart_beat_fly@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/user_heart_beat_fly@2x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/user_heart_beat_fly@2x.png new file mode 100644 index 0000000..3daaf37 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/user_heart_beat_fly@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/user_heart_beat_fly@3x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/user_heart_beat_fly@3x.png new file mode 100644 index 0000000..cd8b6a2 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_fly.imageset/user_heart_beat_fly@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/Contents.json new file mode 100644 index 0000000..680f89a --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "user_heart_beat_heart_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "user_heart_beat_heart_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/user_heart_beat_heart_icon@2x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/user_heart_beat_heart_icon@2x.png new file mode 100644 index 0000000..831b30e Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/user_heart_beat_heart_icon@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/user_heart_beat_heart_icon@3x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/user_heart_beat_heart_icon@3x.png new file mode 100644 index 0000000..11bb42f Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_heart_icon.imageset/user_heart_beat_heart_icon@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_space_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_space_bg.imageset/Contents.json new file mode 100644 index 0000000..58031af --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_space_bg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "user_heart_beat_space_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_space_bg.imageset/user_heart_beat_space_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_space_bg.imageset/user_heart_beat_space_bg@2x.png new file mode 100644 index 0000000..74f3000 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_space_bg.imageset/user_heart_beat_space_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/Contents.json new file mode 100644 index 0000000..05855e1 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "user_heart_beat_title@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "user_heart_beat_title@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/user_heart_beat_title@2x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/user_heart_beat_title@2x.png new file mode 100644 index 0000000..d1c5e86 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/user_heart_beat_title@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/user_heart_beat_title@3x.png b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/user_heart_beat_title@3x.png new file mode 100644 index 0000000..f6990cf Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/亲密关系/user_heart_beat_title.imageset/user_heart_beat_title@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/Contents.json b/QXLive/Other/Assets.xcassets/mine/家族/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/家族/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/Contents.json new file mode 100644 index 0000000..4891aa9 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "family_diamond@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "family_diamond@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/family_diamond@2x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/family_diamond@2x.png new file mode 100644 index 0000000..ff2a75d Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/family_diamond@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/family_diamond@3x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/family_diamond@3x.png new file mode 100644 index 0000000..977c0c4 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_diamond.imageset/family_diamond@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/Contents.json new file mode 100644 index 0000000..63a8c7f --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "family_list_section_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "family_list_section_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/family_list_section_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/family_list_section_bg@2x.png new file mode 100644 index 0000000..9a391a1 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/family_list_section_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/family_list_section_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/family_list_section_bg@3x.png new file mode 100644 index 0000000..0c4beaf Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_list_section_bg.imageset/family_list_section_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/Contents.json new file mode 100644 index 0000000..087dc8b --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "family_top_card_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "family_top_card_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/family_top_card_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/family_top_card_bg@2x.png new file mode 100644 index 0000000..51cc7f3 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/family_top_card_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/family_top_card_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/family_top_card_bg@3x.png new file mode 100644 index 0000000..e99e253 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_top_card_bg.imageset/family_top_card_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/Contents.json new file mode 100644 index 0000000..53e01b1 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "family_top_member_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "family_top_member_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/family_top_member_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/family_top_member_bg@2x.png new file mode 100644 index 0000000..37d0d9f Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/family_top_member_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/family_top_member_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/family_top_member_bg@3x.png new file mode 100644 index 0000000..2dbbe5e Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_top_member_bg.imageset/family_top_member_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/Contents.json new file mode 100644 index 0000000..5b2431f --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "family_top_money_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "family_top_money_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/family_top_money_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/family_top_money_bg@2x.png new file mode 100644 index 0000000..dadf61b Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/family_top_money_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/family_top_money_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/family_top_money_bg@3x.png new file mode 100644 index 0000000..d9540e6 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/family_top_money_bg.imageset/family_top_money_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/Contents.json new file mode 100644 index 0000000..c8efddc --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_family_top_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_family_top_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/mine_family_top_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/mine_family_top_bg@2x.png new file mode 100644 index 0000000..77addc4 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/mine_family_top_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/mine_family_top_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/mine_family_top_bg@3x.png new file mode 100644 index 0000000..f0a221b Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/家族/mine_family_top_bg.imageset/mine_family_top_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/Contents.json new file mode 100644 index 0000000..eccb109 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_set_room_type_sign@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_set_room_type_sign@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/room_set_room_type_sign@2x.png b/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/room_set_room_type_sign@2x.png new file mode 100644 index 0000000..5edc847 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/room_set_room_type_sign@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/room_set_room_type_sign@3x.png b/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/room_set_room_type_sign@3x.png new file mode 100644 index 0000000..488a9a0 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/room_set_room_type_sign.imageset/room_set_room_type_sign@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/Contents.json new file mode 100644 index 0000000..a54836c --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_sign_apply_seat@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_sign_apply_seat@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/room_sign_apply_seat@2x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/room_sign_apply_seat@2x.png new file mode 100644 index 0000000..bc3f44b Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/room_sign_apply_seat@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/room_sign_apply_seat@3x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/room_sign_apply_seat@3x.png new file mode 100644 index 0000000..3a909e2 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_apply_seat.imageset/room_sign_apply_seat@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/Contents.json new file mode 100644 index 0000000..9bcd08f --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_sign_boss_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_sign_boss_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/room_sign_boss_bg@2x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/room_sign_boss_bg@2x.png new file mode 100644 index 0000000..5252b38 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/room_sign_boss_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/room_sign_boss_bg@3x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/room_sign_boss_bg@3x.png new file mode 100644 index 0000000..162c90f Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_boss_bg.imageset/room_sign_boss_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/Contents.json new file mode 100644 index 0000000..a171e72 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_sign_btn@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_sign_btn@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/room_sign_btn@2x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/room_sign_btn@2x.png new file mode 100644 index 0000000..ff0784c Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/room_sign_btn@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/room_sign_btn@3x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/room_sign_btn@3x.png new file mode 100644 index 0000000..4655f6d Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_btn.imageset/room_sign_btn@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/Contents.json new file mode 100644 index 0000000..2bdae3b --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_sign_content_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_sign_content_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/room_sign_content_bg@2x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/room_sign_content_bg@2x.png new file mode 100644 index 0000000..335363d Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/room_sign_content_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/room_sign_content_bg@3x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/room_sign_content_bg@3x.png new file mode 100644 index 0000000..fbcb037 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_content_bg.imageset/room_sign_content_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/Contents.json new file mode 100644 index 0000000..32ef982 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_sign_master_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_sign_master_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/room_sign_master_bg@2x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/room_sign_master_bg@2x.png new file mode 100644 index 0000000..7e9732f Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/room_sign_master_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/room_sign_master_bg@3x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/room_sign_master_bg@3x.png new file mode 100644 index 0000000..0e0986b Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_master_bg.imageset/room_sign_master_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/Contents.json new file mode 100644 index 0000000..b9032ba --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_sign_show_time@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_sign_show_time@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/room_sign_show_time@2x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/room_sign_show_time@2x.png new file mode 100644 index 0000000..0126979 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/room_sign_show_time@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/room_sign_show_time@3x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/room_sign_show_time@3x.png new file mode 100644 index 0000000..b03fe52 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_show_time.imageset/room_sign_show_time@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/Contents.json new file mode 100644 index 0000000..3f312e3 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_sign_time_image@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_sign_time_image@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/room_sign_time_image@2x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/room_sign_time_image@2x.png new file mode 100644 index 0000000..e080991 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/room_sign_time_image@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/room_sign_time_image@3x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/room_sign_time_image@3x.png new file mode 100644 index 0000000..d2171e6 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_time_image.imageset/room_sign_time_image@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/Contents.json new file mode 100644 index 0000000..4d8bb9e --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_sign_title_image@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_sign_title_image@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/room_sign_title_image@2x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/room_sign_title_image@2x.png new file mode 100644 index 0000000..763095f Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/room_sign_title_image@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/room_sign_title_image@3x.png b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/room_sign_title_image@3x.png new file mode 100644 index 0000000..9aaa5d0 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/签约房/room_sign_title_image.imageset/room_sign_title_image@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Contents.json index b00a579..a649c05 100644 --- a/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Contents.json +++ b/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Contents.json @@ -5,12 +5,12 @@ "scale" : "1x" }, { - "filename" : "Frame 1731@2x.png", + "filename" : "gift_number_bg@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Frame 1731@3x.png", + "filename" : "gift_number_bg@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Frame 1731@2x.png b/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Frame 1731@2x.png deleted file mode 100644 index 7103c55..0000000 Binary files a/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Frame 1731@2x.png and /dev/null differ diff --git a/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Frame 1731@3x.png b/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Frame 1731@3x.png deleted file mode 100644 index ef6a632..0000000 Binary files a/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/Frame 1731@3x.png and /dev/null differ diff --git a/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/gift_number_bg@2x.png b/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/gift_number_bg@2x.png new file mode 100644 index 0000000..108e2ca Binary files /dev/null and b/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/gift_number_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/gift_number_bg@3x.png b/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/gift_number_bg@3x.png new file mode 100644 index 0000000..6fece7f Binary files /dev/null and b/QXLive/Other/Assets.xcassets/弹窗/gift_number_bg.imageset/gift_number_bg@3x.png differ diff --git a/QXLive/Other/QXApi.h b/QXLive/Other/QXApi.h index e90f6d2..fb6e0ba 100644 --- a/QXLive/Other/QXApi.h +++ b/QXLive/Other/QXApi.h @@ -158,6 +158,8 @@ static NSString * QXSystemHomeMessage = @"api/UserMessage/get_user_message_cover static NSString * QXSystemMessageList = @"api/UserMessage/get_user_message_list"; /// 消息详情 static NSString * QXSystemMessageInfo = @"api/UserMessage/get_message"; +/// 同意/拒绝加入公会 +static NSString * QXGuildInviteApplyHandle = @"api/Guild/invite_apply_handle"; #pragma mark - 我的 @@ -513,5 +515,32 @@ static NSString * QXBestFriendsList = @"api/User/get_friend_list"; /// 查看更多挚友列表 static NSString * QXBestFriendsMoreList = @"api/User/get_friend_list_more"; +/// 心动空间 +static NSString * QXHeartBeatSpace = @"api/UserCp/cpZone"; +/// 我的家族 +static NSString * QXMyFamily = @"api/Family/myFamily"; +/// 我加入的家族 +static NSString * QXMyJoinFamily = @"api/Family/myJoinFamily"; +/// 家族收益详情 +static NSString * QXMyFamilyEarnings = @"api/Family/familyEarnings"; + + + +/// 签约出价列表 +static NSString * QXSignCoinList = @"api/Sign/sign_coin_list"; +/// 签约出价 +static NSString * QXSignSignCoin = @"api/Sign/sign_coin"; +/// 签约开始 +static NSString * QXSignStartSign = @"api/Sign/start_sign"; +/// 签约结束 +static NSString * QXSignEndSign = @"api/Sign/end_sign"; +/// 才艺列表 +static NSString * QXSignPlayList = @"api/Sign/skill_list"; +/// 免费续约 +static NSString * QXSignFreeResign = @"api/Sign/free_re_sign"; +/// 续签(花金币) +static NSString * QXSignCoinResign = @"api/Sign/re_sign"; +/// 签约延时 +static NSString * QXSignDelaySign = @"api/Sign/sign_delay"; #endif /* Api_h */ diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController+Sign.h b/QXLive/Room(房间)/Controller/QXRoomViewController+Sign.h new file mode 100644 index 0000000..7c42526 --- /dev/null +++ b/QXLive/Room(房间)/Controller/QXRoomViewController+Sign.h @@ -0,0 +1,16 @@ +// +// QXRoomViewController+Sign.h +// QXLive +// +// Created by 启星 on 2025/11/25. +// + +#import "QXRoomViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface QXRoomViewController (Sign) +-(void)resetSignViews; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController+Sign.m b/QXLive/Room(房间)/Controller/QXRoomViewController+Sign.m new file mode 100644 index 0000000..378feb4 --- /dev/null +++ b/QXLive/Room(房间)/Controller/QXRoomViewController+Sign.m @@ -0,0 +1,44 @@ +// +// QXRoomViewController+Sign.m +// QXLive +// 签约房 +// Created by 启星 on 2025/11/25. +// + +#import "QXRoomViewController+Sign.h" + +@implementation QXRoomViewController (Sign) +-(void)resetSignViews{ + [self.seatContentView setType:QXRoomSeatViewTypeSign]; + [self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(self.view); + make.top.mas_equalTo(self.titleView.bottom); + make.height.mas_equalTo(ScaleWidth(315)+10); + }]; + [self.chatListView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(self.bottomView.mas_top); + make.left.equalTo(self.view); + make.top.equalTo(self.seatContentView.mas_bottom); + // make.right.equalTo(self.soundBtn.mas_left).offset(-16); + make.width.mas_equalTo(ScaleWidth(280)); + }]; + +} + +/// 签约开始 +-(void)signDidStartWithEndTime:(NSString *)endTime signId:(NSString *)signId signDay:(NSString*)signDay signValue:(NSString*)signValue{ + [self.seatContentView signDidStartWithEndTime:endTime signId:signId signDay:signDay signValue:signValue]; +} +/// 签约结束 +-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value{ + [self.seatContentView signDidEndWithUserInfo1:userInfo1 userInfo2:userInfo2 sign_value:sign_value]; +} +/// 签约身价变化 +-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId{ + [self.seatContentView signValueDidChangedWithSignUserInfo:signUserInfo sign_value:sign_value signId:signId]; +} +/// 签约身价变化 +-(void)signTimeDelayWithEndTime:(NSString*)endTime{ + [self.seatContentView signTimeDelayWithEndTime:endTime]; +} +@end diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController.m b/QXLive/Room(房间)/Controller/QXRoomViewController.m index d3019e5..8b045bb 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController.m +++ b/QXLive/Room(房间)/Controller/QXRoomViewController.m @@ -40,6 +40,7 @@ #import "QXRoomDayTaskTagView.h" #import "QXTaskViewController.h" #import "QXRoomViewController+Singer.h" +#import "QXRoomViewController+Sign.h" #import "QXDrifNobilityJoinRoomView.h" @interface QXRoomViewController ()< @@ -149,7 +150,7 @@ QXRoomUserInfoViewDelegate dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [[QXGiftPlayerManager shareManager] startPlay]; [[QXGiftDisplayManager sharedManager] becomeFront]; -// [[QXDrifNobilityJoinRoomView shareView] dirfViewBecomeToFront]; + [[QXDrifNobilityJoinRoomView shareView] dirfViewBecomeToFront]; }); self.navigationController.viewControllers = marr; // self.navigationController.interactivePopGestureRecognizer.enabled = NO; @@ -267,6 +268,14 @@ QXRoomUserInfoViewDelegate QXEffectContentView *chatEffectView = [[QXGiftPlayerManager shareManager] defaultChatEffectView]; [chatEffectView mas_makeConstraints:^(MASConstraintMaker *make) { // make.top.equalTo(self.seatContentView.mas_bottom).offset(padding); +// make.left.right.equalTo(self.bgEffectView); + make.bottom.mas_equalTo(-padding); + make.centerX.equalTo(self.bgEffectView); + make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT)); + }]; + QXCPEffectView *cpEffectView = [[QXGiftPlayerManager shareManager] defaultCpEffectView]; + [cpEffectView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.top.equalTo(self.seatContentView.mas_bottom).offset(padding); // make.left.right.equalTo(self.bgEffectView); make.bottom.mas_equalTo(-padding); make.centerX.equalTo(self.bgEffectView); @@ -458,6 +467,8 @@ QXRoomUserInfoViewDelegate [self resetFriendViews]; }else if (self.roomModel.room_info.type_id.intValue == 9) { [self resetSingerViews]; + }else if (self.roomModel.room_info.type_id.intValue == 10) { + [self resetSignViews]; } if (self.roomModel.room_info.last_pk_room_id.isExist) { @@ -841,6 +852,11 @@ QXRoomUserInfoViewDelegate [self.bottomView setMuteAudioStatus:NO]; } } + if (self.seatContentView.myPitNumber == 9) { + self.soundBtn.hidden = NO; + }else{ + self.soundBtn.hidden = YES; + } return; } [[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:isUpSeat]; @@ -863,10 +879,8 @@ QXRoomUserInfoViewDelegate } if (self.seatContentView.myPitNumber == 9) { self.soundBtn.hidden = NO; -// self.titleView.isCompere = YES; }else{ self.soundBtn.hidden = YES; -// self.titleView.isCompere = NO; } [self configBottomTools]; } diff --git a/QXLive/Room(房间)/View/PK/QXRoomPKTimeSetView.m b/QXLive/Room(房间)/View/PK/QXRoomPKTimeSetView.m index babe4ff..44ab107 100644 --- a/QXLive/Room(房间)/View/PK/QXRoomPKTimeSetView.m +++ b/QXLive/Room(房间)/View/PK/QXRoomPKTimeSetView.m @@ -148,11 +148,24 @@ showToast(@"请选择PK时长"); return; } - MJWeakSelf + __weak typeof(self) weakSelf = self; [QXMineNetwork roomPkStartWithPk_id:self.pkId pk_times:self.timeModel.relation_id successBlock:^(NSDictionary * _Nonnull dict) { - [weakSelf hide]; + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated, skipping hide operation"); + return; + } + dispatch_async(dispatch_get_main_queue(), ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf hide]; + } + }); } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - showToast(msg); + // 错误回调也要确保在主线程 + dispatch_async(dispatch_get_main_queue(), ^{ + showToast(msg); + }); }]; } @@ -220,10 +233,21 @@ }]; } -(void)hide{ + if (!self.superview) { + NSLog(@"⚠️ View already removed from superview"); + return; + } [UIView animateWithDuration:0.3 animations:^{ - self.bgView.y = SCREEN_HEIGHT; + if (self.bgView) { + self.bgView.y = SCREEN_HEIGHT; + } } completion:^(BOOL finished) { - [self removeFromSuperview]; + // 检查是否已经被移除 + if (self.superview) { + [self removeFromSuperview]; + } + // 避免在 dealloc 过程中访问其他属性 + // 不要在 completion block 中访问或设置其他属性 }]; } @end diff --git a/QXLive/Room(房间)/View/QXRoomChatListView.h b/QXLive/Room(房间)/View/QXRoomChatListView.h index 327decc..16876db 100644 --- a/QXLive/Room(房间)/View/QXRoomChatListView.h +++ b/QXLive/Room(房间)/View/QXRoomChatListView.h @@ -13,6 +13,7 @@ #import "QXRoomFriendRelationModel.h" #import "QXEmojiTypeModel.h" #import "QXSeatHeaderView.h" +#import "CKShimmerLabel.h" NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger) { @@ -41,12 +42,14 @@ typedef NS_ENUM(NSInteger) { @property(nonatomic,strong)QXSeatHeaderView *headerImageView; @property(nonatomic,strong)UIView *iconBgView; @property(nonatomic,strong)NSMutableArray *iconViewArray; -@property(nonatomic,strong)UILabel *nameLabel; +@property(nonatomic,strong)CKShimmerLabel *nameLabel; @property(nonatomic,strong)UILabel *titleLabel; @property(nonatomic,strong)UIImageView *bubbleImageView; @property (nonatomic,strong)QXRoomChatListModel *message; @property (nonatomic,weak)iddelegate; -(void)loadBubble; +-(void)nameStartAnimate; +-(void)nameStopAnimate; +(instancetype)cellWithTableView:(UITableView *)tableView; @end @@ -77,12 +80,14 @@ typedef NS_ENUM(NSInteger) { /// 礼物数量 @property(nonatomic,strong)UILabel *giftCountLabel; @property(nonatomic,strong)NSMutableArray *iconViewArray; -@property(nonatomic,strong)UILabel *nameLabel; +@property(nonatomic,strong)CKShimmerLabel *nameLabel; @property(nonatomic,strong)SDAnimatedImageView *animatedImageView; @property(nonatomic,strong)UIImageView *bubbleImageView; @property (nonatomic,strong)QXRoomChatListModel *message; @property (nonatomic,weak)iddelegate; -(void)loadBubble; +-(void)nameStartAnimate; +-(void)nameStopAnimate; +(instancetype)cellWithTableView:(UITableView *)tableView; @end @@ -97,6 +102,7 @@ typedef NS_ENUM(NSInteger) { @interface QXRoomChatListModel : NSObject @property (nonatomic,assign)QXRoomChatMessageType messageType; @property (nonatomic,strong)NSString* text; +@property (nonatomic,strong)NSString* rights_icon; @property (nonatomic,strong)QXGiftModel* GiftInfo; @property (nonatomic,strong)NSArray* GiftInfos; @property (nonatomic,strong)QXUserHomeModel* FromUserInfo; diff --git a/QXLive/Room(房间)/View/QXRoomChatListView.m b/QXLive/Room(房间)/View/QXRoomChatListView.m index 88711f6..62ee82a 100644 --- a/QXLive/Room(房间)/View/QXRoomChatListView.m +++ b/QXLive/Room(房间)/View/QXRoomChatListView.m @@ -285,6 +285,7 @@ NSInteger maxMessageCount = 20; if ([cell isKindOfClass:[QXRoomChatListCell class]]) { QXRoomChatListCell *Listcell = (QXRoomChatListCell *)cell; [Listcell loadBubble]; + [Listcell nameStartAnimate]; return; } if ([cell isKindOfClass:[QXRoomGiftListCell class]]) { @@ -295,6 +296,7 @@ NSInteger maxMessageCount = 20; if ([cell isKindOfClass:[QXRoomEmojiListCell class]]) { QXRoomEmojiListCell *Listcell = (QXRoomEmojiListCell *)cell; [Listcell loadBubble]; + [Listcell nameStartAnimate]; return; } } @@ -303,6 +305,7 @@ NSInteger maxMessageCount = 20; if ([cell isKindOfClass:[QXRoomChatListCell class]]) { QXRoomChatListCell *Listcell = (QXRoomChatListCell *)cell; [Listcell.bubbleImageView sd_cancelLatestImageLoad]; + [Listcell nameStopAnimate]; } if ([cell isKindOfClass:[QXRoomGiftListCell class]]) { @@ -314,6 +317,7 @@ NSInteger maxMessageCount = 20; QXRoomEmojiListCell *Listcell = (QXRoomEmojiListCell *)cell; [Listcell.bubbleImageView sd_cancelLatestImageLoad]; [Listcell.animatedImageView sd_cancelLatestImageLoad]; + [Listcell nameStopAnimate]; return; } } @@ -371,11 +375,12 @@ NSInteger maxMessageCount = 20; CGFloat distanceFromBottom = scrollView.contentSize.height - contentYoffset; if (distanceFromBottom < height) { self.isDragging = NO; - } - CGFloat bottomEdge = scrollView.contentOffset.y + scrollView.frame.size.height; - if (scrollView.contentSize.height-bottomEdge) { self.messageCountBtn.hidden = YES; } +// CGFloat bottomEdge = scrollView.contentOffset.y + scrollView.frame.size.height; +// if (scrollView.contentSize.height-bottomEdge) { +// self.messageCountBtn.hidden = YES; +// } } -(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{ @@ -485,11 +490,11 @@ NSInteger maxMessageCount = 20; } self.titleLabel.attributedText = attr; self.nameLabel.text = message.FromUserInfo.nickname; - if ([message.FromUserInfo.nickname_color isExist]) { - self.nameLabel.textColor = [UIColor colorWithHexString:message.FromUserInfo.nickname_color]; - }else{ - self.nameLabel.textColor = RGB16(0xDED6ED); - } +// if ([message.FromUserInfo.nickname_color isExist]) { +// self.nameLabel.textColor = [UIColor colorWithHexString:message.FromUserInfo.nickname_color]; +// }else{ +// self.nameLabel.textColor = RGB16(0xDED6ED); +// } [self.headerImageView setHeadIcon:message.FromUserInfo.avatar dress:@""]; [self.headerImageView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:message.FromUserInfo.nobility_image]]; self.iconBgView.hidden = YES; @@ -545,14 +550,21 @@ NSInteger maxMessageCount = 20; make.bottom.right.equalTo(self.headerImageView).offset(2); }]; - self.nameLabel = [[UILabel alloc] init]; + self.nameLabel = [[CKShimmerLabel alloc] initWithFrame:CGRectMake(32, 0, 200, 24)]; +// self.nameLabel.text = @"羽声语音"; + self.nameLabel.shimmerWidth = 20; + self.nameLabel.shimmerRadius = 20; + self.nameLabel.durationTime = 1; + self.nameLabel.repeat = YES; self.nameLabel.textColor = RGB16(0xDED6ED); - self.nameLabel.font = [UIFont systemFontOfSize:14]; +// self.nameLabel.shimmerColor = [UIColor yellowColor]; + self.nameLabel.font = [UIFont boldSystemFontOfSize:14]; [self.bgView addSubview:self.nameLabel]; [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.headerImageView).offset(-3); make.left.equalTo(self.headerImageView.mas_right).offset(6); make.height.mas_equalTo(18); + make.width.mas_greaterThanOrEqualTo(200); }]; @@ -645,6 +657,23 @@ NSInteger maxMessageCount = 20; self.bubbleImageView.backgroundColor = UIColor.clearColor; } } +-(void)nameStartAnimate{ + if ([self.message.FromUserInfo.nickname_color isExist]) { + [self.nameLabel stopShimmer]; + [self.nameLabel layoutSubviews]; + self.nameLabel.shimmerWidth = 20; + self.nameLabel.shimmerRadius = 20; + self.nameLabel.durationTime = 1; + self.nameLabel.shimmerColor = [UIColor colorWithHexString:self.message.FromUserInfo.nickname_color]; + [self.nameLabel startShimmer]; + } +} +-(void)nameStopAnimate{ + if ([self.message.FromUserInfo.nickname_color isExist]) { + self.nameLabel.shimmerColor = [UIColor colorWithHexString:self.message.FromUserInfo.nickname_color]; + [self.nameLabel stopShimmer]; + } +} -(NSMutableArray *)iconViewArray{ if (!_iconViewArray) { _iconViewArray = [NSMutableArray array]; @@ -910,11 +939,11 @@ NSInteger maxMessageCount = 20; -(void)setMessage:(QXRoomChatListModel *)message{ _message = message; self.nameLabel.text = message.FromUserInfo.nickname; - if ([message.FromUserInfo.nickname_color isExist]) { - self.nameLabel.textColor = [UIColor colorWithHexString:message.FromUserInfo.nickname_color]; - }else{ - self.nameLabel.textColor = RGB16(0xDED6ED); - } +// if ([message.FromUserInfo.nickname_color isExist]) { +// self.nameLabel.textColor = [UIColor colorWithHexString:message.FromUserInfo.nickname_color]; +// }else{ +// self.nameLabel.textColor = RGB16(0xDED6ED); +// } [self.headerImageView setHeadIcon:message.FromUserInfo.avatar dress:@""]; [self.headerImageView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:message.FromUserInfo.nobility_image]]; self.iconBgView.hidden = YES; @@ -1000,14 +1029,21 @@ NSInteger maxMessageCount = 20; make.bottom.right.equalTo(self.headerImageView).offset(2); }]; - self.nameLabel = [[UILabel alloc] init]; + self.nameLabel = [[CKShimmerLabel alloc] initWithFrame:CGRectMake(32, 0, 200, 24)]; +// self.nameLabel.text = @"羽声语音"; + self.nameLabel.shimmerWidth = 20; + self.nameLabel.shimmerRadius = 20; + self.nameLabel.durationTime = 1; + self.nameLabel.repeat = YES; self.nameLabel.textColor = RGB16(0xDED6ED); - self.nameLabel.font = [UIFont systemFontOfSize:14]; +// self.nameLabel.shimmerColor = [UIColor yellowColor]; + self.nameLabel.font = [UIFont boldSystemFontOfSize:14]; [self.bgView addSubview:self.nameLabel]; [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.headerImageView).offset(-3); make.left.equalTo(self.headerImageView.mas_right).offset(6); make.height.mas_equalTo(18); + make.width.mas_greaterThanOrEqualTo(200); }]; @@ -1093,6 +1129,23 @@ NSInteger maxMessageCount = 20; self.bgView.backgroundColor = messageBubbleColor; } } +-(void)nameStartAnimate{ + if ([self.message.FromUserInfo.nickname_color isExist]) { + [self.nameLabel stopShimmer]; + [self.nameLabel layoutSubviews]; + self.nameLabel.shimmerWidth = 20; + self.nameLabel.shimmerRadius = 20; + self.nameLabel.durationTime = 1; + self.nameLabel.shimmerColor = [UIColor colorWithHexString:self.message.FromUserInfo.nickname_color]; + [self.nameLabel startShimmer]; + } +} +-(void)nameStopAnimate{ + if ([self.message.FromUserInfo.nickname_color isExist]) { + self.nameLabel.shimmerColor = [UIColor colorWithHexString:self.message.FromUserInfo.nickname_color]; + [self.nameLabel stopShimmer]; + } +} -(NSMutableArray *)iconViewArray{ if (!_iconViewArray) { _iconViewArray = [NSMutableArray array]; diff --git a/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.m b/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.m index acd9452..a70a23b 100644 --- a/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.m +++ b/QXLive/Room(房间)/View/拍卖房/QXSelectAuctionInfoView.m @@ -113,9 +113,19 @@ showToast(@"请选择礼物"); return; } - MJWeakSelf + __weak typeof(self) weakSelf = self; [QXMineNetwork roomAuctionStartWithRoomId:self.roomId user_id:self.userId gift_id:self.giftModel.gift_id relation_id:self.relationModel.relation_id auction_type:self.isRealLove?@"1":@"2" time_day:self.timeModel.relation_id successBlock:^(NSDictionary * _Nonnull dict) { - [weakSelf hide]; + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated, skipping hide operation"); + return; + } + dispatch_async(dispatch_get_main_queue(), ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf hide]; + } + }); } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { showToast(msg); }]; @@ -292,10 +302,21 @@ }]; } -(void)hide{ + if (!self.superview) { + NSLog(@"⚠️ View already removed from superview"); + return; + } [UIView animateWithDuration:0.3 animations:^{ - self.bgView.y = SCREEN_HEIGHT; + if (self.bgView) { + self.bgView.y = SCREEN_HEIGHT; + } } completion:^(BOOL finished) { - [self removeFromSuperview]; + // 检查是否已经被移除 + if (self.superview) { + [self removeFromSuperview]; + } + // 避免在 dealloc 过程中访问其他属性 + // 不要在 completion block 中访问或设置其他属性 }]; } -(NSMutableArray *)relationshipArray{ diff --git a/QXLive/Room(房间)/View/排行榜/QXRoomRankSubView.m b/QXLive/Room(房间)/View/排行榜/QXRoomRankSubView.m index 13d695a..0a5f71f 100644 --- a/QXLive/Room(房间)/View/排行榜/QXRoomRankSubView.m +++ b/QXLive/Room(房间)/View/排行榜/QXRoomRankSubView.m @@ -163,40 +163,50 @@ time_type = @"3"; } - MJWeakSelf + __weak typeof(self) weakSelf = self; [QXMineNetwork roomRankListWithRoomId:self.roomId type:self.type time_type:time_type page:self.page successBlock:^(NSArray * _Nonnull list) { - if (weakSelf.page == 1) { - weakSelf.firstView.md = nil; - weakSelf.secondView.md = nil; - weakSelf.thirdView.md = nil; - [weakSelf.dataArray removeAllObjects]; - [weakSelf.topArray removeAllObjects]; + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated, skipping hide operation"); + return; + } + if (strongSelf.page == 1) { + strongSelf.firstView.md = nil; + strongSelf.secondView.md = nil; + strongSelf.thirdView.md = nil; + [strongSelf.dataArray removeAllObjects]; + [strongSelf.topArray removeAllObjects]; for (int i = 0 ; i < list.count; i++) { QXRoomOnlineList*md = list[i]; if (i == 0) { // [weakSelf.topArray addObject:md]; - weakSelf.firstView.md = md; + strongSelf.firstView.md = md; }else if (i == 1) { - weakSelf.secondView.md = md; + strongSelf.secondView.md = md; }else if (i == 2) { - weakSelf.thirdView.md = md; + strongSelf.thirdView.md = md; }else{ - [weakSelf.dataArray addObject:md]; + [strongSelf.dataArray addObject:md]; } } }else{ - [weakSelf.dataArray addObjectsFromArray:list]; + [strongSelf.dataArray addObjectsFromArray:list]; } - [self.tableView reloadData]; + [strongSelf.tableView reloadData]; if (list.count == 0) { - self.tableView.mj_footer.state = MJRefreshStateNoMoreData; + strongSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData; }else{ - [self.tableView.mj_footer endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; } - [self.tableView.mj_header endRefreshing]; + [strongSelf.tableView.mj_header endRefreshing]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - [self.tableView.mj_header endRefreshing]; - [self.tableView.mj_footer endRefreshing]; + dispatch_async(dispatch_get_main_queue(), ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf.tableView.mj_header endRefreshing]; + [strongSelf.tableView.mj_footer endRefreshing]; + } + }); }]; } diff --git a/QXLive/Room(房间)/View/用户信息/QXRoomUserInfoView.m b/QXLive/Room(房间)/View/用户信息/QXRoomUserInfoView.m index 084ce64..3f23185 100644 --- a/QXLive/Room(房间)/View/用户信息/QXRoomUserInfoView.m +++ b/QXLive/Room(房间)/View/用户信息/QXRoomUserInfoView.m @@ -25,7 +25,7 @@ #import "QXUserCpDressView.h" #import "QXHeartBeatSpaceViewController.h" -@interface QXRoomUserInfoView() +@interface QXRoomUserInfoView() @property (nonatomic,strong)UIView *bgView; @property (nonatomic,strong)UIImageView *bgImageView; /// 头像 @@ -395,6 +395,8 @@ self.cpContentView = [[QXUserCpCardView alloc] init]; + self.cpContentView.userId = self.userId; + self.cpContentView.delegate = self; MJWeakSelf [self.cpContentView addTapBlock:^(id _Nonnull obj) { QXHeartBeatSpaceViewController*vc = [[QXHeartBeatSpaceViewController alloc] init]; @@ -454,7 +456,22 @@ -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ return touch.view == self; } +-(void)didClickHeaderViewUserId:(NSString*)userId{ + [self hide]; + QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init]; + vc.user_id = userId; + [self.viewController.navigationController pushViewController:vc animated:YES]; +} +-(void)didClickHeaderCardViewWithUserId:(NSString*)userId{ + if (self.userModel.cp_info != nil) { + [self hide]; + QXHeartBeatSpaceViewController *vc = [[QXHeartBeatSpaceViewController alloc] init]; + vc.userId = self.userId; + [self.viewController.navigationController pushViewController:vc animated:YES]; + } + +} -(void)clearCharmAction{ [QXMineNetwork roomClearCharmWithRoomId:self.roomId userId:self.userId successBlock:^(NSDictionary * _Nonnull dict) { @@ -495,6 +512,7 @@ //} -(void)setUserId:(NSString *)userId{ _userId = userId; + self.cpContentView.userId = self.userId; if (self.isCompere) { // 主持查看别人 显示更多按钮 显示底部 @TA... self.moreBtn.hidden = NO; @@ -591,6 +609,8 @@ weakSelf.cpDressView.hidden = NO; weakSelf.cpDressView.model = model.cp_info; weakSelf.cpContentView.model = model.cp_info; + }else{ + [weakSelf.cpContentView resetView]; } // weakSelf.sexImageView.image = model.sex.intValue==1?[UIImage imageNamed:@"user_sex_boy"]:[UIImage imageNamed:@"user_sex_girl"]; // [weakSelf.sexImageView mas_remakeConstraints:^(MASConstraintMaker *make) { @@ -601,7 +621,11 @@ [weakSelf.collectionView reloadData]; weakSelf.idLabel.text = [NSString stringWithFormat:@"%@ ID:%@",model.sex.intValue==1?@"男":@"女",model.user_code]; weakSelf.guildLabel.text = [NSString stringWithFormat:@"所属公会:%@",[model.guild isExist]?model.guild:@"无"]; - weakSelf.joinGuildBtn.hidden = ![model.guild isExist]; + if (![model.guild isExist] && ![weakSelf.userId isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) { + weakSelf.joinGuildBtn.hidden = NO; + }else{ + weakSelf.joinGuildBtn.hidden = YES; + } [weakSelf.upSeatBtn setTitle:model.is_in_pit.intValue==1?QXText(@"下麦"):QXText(@"抱麦") forState:(UIControlStateNormal)]; [weakSelf.moreGiftBtn setTitle:[NSString localizedStringWithFormat:QXText(@"90天内累计收到%@个礼物"),model.gift_num] forState:(UIControlStateNormal)]; [weakSelf.moreGiftBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleRight) imageTitleSpace:2]; diff --git a/QXLive/Room(房间)/View/用户信息/QXUserCpCardView.h b/QXLive/Room(房间)/View/用户信息/QXUserCpCardView.h index e01a12a..2c9e159 100644 --- a/QXLive/Room(房间)/View/用户信息/QXUserCpCardView.h +++ b/QXLive/Room(房间)/View/用户信息/QXUserCpCardView.h @@ -8,9 +8,21 @@ #import NS_ASSUME_NONNULL_BEGIN +@protocol QXUserCpCardViewDelegate +@optional + +-(void)didClickHeaderViewUserId:(NSString*)userId; + +-(void)didClickHeaderCardViewWithUserId:(NSString*)userId;; + +@end @interface QXUserCpCardView : UIView @property (nonatomic,strong)QXUserCpInfoModel *model; +@property (nonatomic,strong)NSString *userId; +@property (nonatomic,weak)iddelegate; +-(void)resetView; +-(void)headerStartPlay; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/用户信息/QXUserCpCardView.m b/QXLive/Room(房间)/View/用户信息/QXUserCpCardView.m index 809d23d..8c6cf16 100644 --- a/QXLive/Room(房间)/View/用户信息/QXUserCpCardView.m +++ b/QXLive/Room(房间)/View/用户信息/QXUserCpCardView.m @@ -15,10 +15,12 @@ @property (nonatomic,strong)UIImageView *heartImageView; @property (nonatomic,strong)UILabel *levelValueLabel; +@property (nonatomic,strong)UIButton *leftBtn; @property (nonatomic,strong)QXSeatHeaderView *leftHeaderImageView; @property (nonatomic,strong)UILabel *leftNameLabel; @property (nonatomic,strong)QXSeatHeaderView *rightHeaderImageView; @property (nonatomic,strong)UILabel *righttNameLabel; +@property (nonatomic,strong)UIButton *rightBtn; @end @implementation QXUserCpCardView @@ -135,11 +137,63 @@ make.top.equalTo(self.rightHeaderImageView.mas_bottom).offset(5); make.height.mas_equalTo(12); }]; + + self.leftBtn = [[UIButton alloc] init]; + [self.leftBtn addTarget:self action:@selector(leftAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self addSubview:self.leftBtn]; + [self.leftBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.top.left.equalTo(self.leftHeaderImageView); + make.bottom.equalTo(self.leftNameLabel); + }]; + + self.rightBtn = [[UIButton alloc] init]; + [self.rightBtn addTarget:self action:@selector(righttAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self addSubview:self.rightBtn]; + [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.top.left.equalTo(self.rightHeaderImageView); + make.bottom.equalTo(self.righttNameLabel); + }]; + MJWeakSelf + [self addTapBlock:^(id _Nonnull obj) { + if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickHeaderCardViewWithUserId:)]) { + [weakSelf.delegate didClickHeaderCardViewWithUserId:weakSelf.userId]; + } + }]; +} +-(void)headerStartPlay{ + [self.leftHeaderImageView playHWDMP4]; + [self.rightHeaderImageView playHWDMP4]; +} + +-(void)leftAction{ + if (self.model == nil) { + return; + } + NSString *userId = @""; + userId = self.userId; + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderViewUserId:)]) { + [self.delegate didClickHeaderViewUserId:userId]; + } +} + +-(void)righttAction{ + if (self.model == nil) { + return; + } + NSString *userId = @""; + if ([self.model.user_info1.user_id isEqualToString:self.userId]) { + userId = self.model.user_info2.user_id; + }else{ + userId = self.model.user_info1.user_id; + } + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickHeaderViewUserId:)]) { + [self.delegate didClickHeaderViewUserId:userId]; + } } -(void)setModel:(QXUserCpInfoModel *)model{ _model = model; - if ([model.user_info1.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) { + if ([model.user_info1.user_id isEqualToString:self.userId]) { [self.leftHeaderImageView setHeadIcon:model.user_info1.avatar dress:model.user_info1.dress]; [self.rightHeaderImageView setHeadIcon:model.user_info2.avatar dress:model.user_info2.dress]; self.leftNameLabel.text = model.user_info1.nickname; @@ -150,8 +204,24 @@ self.leftNameLabel.text = model.user_info2.nickname; self.righttNameLabel.text = model.user_info1.nickname; } - self.levelLabel.text = [NSString stringWithFormat:@"LV%@ %@",model.level,model.name]; - self.levelValueLabel.text = [NSString qx_showHotCountNum:model.exp.longLongValue]; + if (model) { + self.levelLabel.text = [NSString stringWithFormat:@"LV%@ %@",model.level,model.name]; + self.levelValueLabel.text = [NSString qx_showHotCountNum:model.exp.longLongValue]; + }else{ + self.levelLabel.text = @""; + self.levelValueLabel.text = @""; + } + // self.cpTagLabel.text = model.name; +} +-(void)resetView{ + self.model = nil; + [self.leftHeaderImageView setHeadIcon:@"" dress:@""]; + [self.rightHeaderImageView setHeadIcon:@"" dress:@""]; + self.leftNameLabel.text = @""; + self.righttNameLabel.text = @""; + self.levelLabel.text = @""; + self.levelValueLabel.text = @""; + } @end diff --git a/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.h b/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.h index 74e937f..b02d2c7 100644 --- a/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.h +++ b/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.h @@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN @interface QXUserCpDressView : UIView @property (nonatomic,strong)QXUserCpInfoModel *model; +-(void)headerStartPlay; +-(void)hideHeader; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.m b/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.m index 2356061..896b180 100644 --- a/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.m +++ b/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.m @@ -59,6 +59,9 @@ } -(void)setModel:(QXUserCpInfoModel *)model{ + if (_model!=nil) { + return; + } _model = model; if ([model.user_info1.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) { [self.headerView1 sd_setImageWithURL:[NSURL URLWithString:model.user_info1.avatar]]; @@ -169,8 +172,15 @@ return; } } - +-(void)hideHeader{ + self.headerView1.hidden = YES; + self.headerView2.hidden = YES; +} +-(void)headerStartPlay{ + [self playHWDMP4]; +} -(void)displayDressWithDressUrl:(NSString*)dressUrl{ + [self stopHWDMP4]; if (dressUrl.length > 0 && ([dressUrl hasPrefix:@"http"] || [dressUrl hasPrefix:@"https"])) { if ([dressUrl isExist]) { if ([dressUrl hasSuffix:@"svga"]) { @@ -215,6 +225,7 @@ if (![self.model.pendant isExist]) { return; } + [self.mp4View setMute:YES]; [self.mp4View playHWDMP4:self.videoPath repeatCount:INTMAX_MAX delegate:self]; } //- (QXEffectSvgaView *)svgaView { diff --git a/QXLive/Room(房间)/View/直播/QXSeatHeaderView.m b/QXLive/Room(房间)/View/直播/QXSeatHeaderView.m index bc36f52..1e0ddc7 100644 --- a/QXLive/Room(房间)/View/直播/QXSeatHeaderView.m +++ b/QXLive/Room(房间)/View/直播/QXSeatHeaderView.m @@ -62,20 +62,24 @@ self.nobilityImageView.contentMode = UIViewContentModeScaleToFill; [self addSubview:self.nobilityImageView]; [self.nobilityImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.bottom.equalTo(self); + make.bottom.equalTo(self); + make.left.mas_equalTo(-5); + make.right.mas_equalTo(5); make.height.mas_equalTo(self.nobilityImageView.mas_width).multipliedBy(0.54); }]; [self addSubview:self.svgaView]; [self.svgaView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.top.equalTo(self).offset(-6); - make.right.bottom.equalTo(self).offset(6); + make.right.equalTo(self).offset(6); + make.bottom.equalTo(self.headImageView.mas_bottom).offset(6); }]; [self addSubview:self.mp4View]; [self.mp4View mas_makeConstraints:^(MASConstraintMaker *make) { make.left.top.equalTo(self).offset(-6); - make.right.bottom.equalTo(self).offset(6); + make.right.equalTo(self).offset(6); + make.bottom.equalTo(self.headImageView.mas_bottom).offset(6); }]; } @@ -131,6 +135,9 @@ if (![_dress isExist]) { return; } + if (![self.videoPath isExist]) { + return; + } [self.mp4View playHWDMP4:self.videoPath repeatCount:INTMAX_MAX delegate:self]; } - (QXEffectSvgaView *)svgaView { @@ -143,7 +150,7 @@ - (VAPView *)mp4View { if (!_mp4View) { _mp4View = [[VAPView alloc] initWithFrame:CGRectZero]; - _mp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypeDoNothing; + _mp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypePauseAndResume; _mp4View.contentMode = UIViewContentModeScaleAspectFit; _mp4View.userInteractionEnabled = NO; _mp4View.backgroundColor = [UIColor clearColor]; diff --git a/QXLive/Room(房间)/View/礼物特效/QXCPEffectView.h b/QXLive/Room(房间)/View/礼物特效/QXCPEffectView.h new file mode 100644 index 0000000..67a0182 --- /dev/null +++ b/QXLive/Room(房间)/View/礼物特效/QXCPEffectView.h @@ -0,0 +1,21 @@ +// +// QXCPEffectView.h +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import +#import "UIView+VAP.h" +NS_ASSUME_NONNULL_BEGIN + +@interface QXCPEffectView : UIView +@property (nonatomic,strong) VAPView *playerMp4View; +-(void)displayCpEffectUrl:(QXRoomChatListModel*)model; +@property (nonatomic, strong) dispatch_queue_t queue; +- (void)destroyEffectView; +-(void)stopPlay; +-(void)startPlay; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/礼物特效/QXCPEffectView.m b/QXLive/Room(房间)/View/礼物特效/QXCPEffectView.m new file mode 100644 index 0000000..6900ec4 --- /dev/null +++ b/QXLive/Room(房间)/View/礼物特效/QXCPEffectView.m @@ -0,0 +1,285 @@ +// +// QXCPEffectView.m +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import "QXCPEffectView.h" +#import "QXEffectSvgaView.h" +#import "QXFileManager.h" + +@interface QXCPEffectView() +@property (nonatomic,strong)UIView *bgView; +@property (nonatomic,strong)QXSeatHeaderView *leftHeadeView; +@property (nonatomic,strong)QXSeatHeaderView *rightHeadeView; +@property (nonatomic,strong)QXEffectSvgaView *svagView; +@property (nonatomic,strong)NSMutableArray *dataArray; +@property (nonatomic, strong) NSRecursiveLock *lock; +@property (nonatomic, assign) BOOL isLoadEffect; +@property (nonatomic, strong) QXRoomChatListModel *playModel; +@property (nonatomic, assign) BOOL isPlaying; +@end +@implementation QXCPEffectView +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + self.userInteractionEnabled = NO; + self.isLoadEffect = NO; + [self initSubviews]; + } + return self; +} +-(void)initSubviews{ + self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, ScaleWidth(600))]; + [self addSubview:self.bgView]; +// [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.left.right.equalTo(self); +// make.height.equalTo(self.mas_width); +// make.top.mas_equalTo(SCREEN_HEIGHT); +// }]; + + + [self.bgView addSubview:self.svagView]; + [self.bgView addSubview:self.playerMp4View]; + + [self.svagView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.bgView); + }]; + [self.playerMp4View mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.bgView); + }]; + + self.leftHeadeView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake((self.bgView.width-60)/2-3, (self.bgView.height-60)/2-3, 60, 60)]; + self.leftHeadeView.hidden = YES; + [self.leftHeadeView addRoundedCornersWithRadius:30]; + [self.bgView addSubview:self.leftHeadeView]; + [self.leftHeadeView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self.bgView).offset(-32); + make.centerY.equalTo(self.bgView).offset(80); + make.width.height.mas_equalTo(60); + }]; + self.rightHeadeView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake(self.leftHeadeView.right+3, self.leftHeadeView.top, 60, 60)]; + self.rightHeadeView.hidden = YES; + [self.bgView addSubview:self.rightHeadeView]; + [self.rightHeadeView addRoundedCornersWithRadius:30]; + [self.rightHeadeView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.leftHeadeView.mas_right).offset(2); + make.centerY.equalTo(self.leftHeadeView); + make.width.height.mas_equalTo(60); + }]; +} +-(void)displayCpEffectUrl:(QXRoomChatListModel *)model{ + NSString *play_image = model.rights_icon; + dispatch_async(self.queue, ^{ + /// 如果play_image不存在return + if (![play_image isExist]) { + return; + } + /// 将play_image链接转为小写 + NSString *pathExtension = [play_image pathExtension].lowercaseString; + /// 判定礼物的后缀是否为svga或者mp4如果非这两种 则return + if (!([pathExtension isEqualToString:@"svga"] || [pathExtension isEqualToString:@"mp4"])) { + return; + } + /// 锁住list + [self.lock lock]; + /// 添加礼物进list + [self.dataArray addObject:model]; + NSLog(@"当前礼物有---%ld个",self.dataArray.count); + /// 解锁 + [self.lock unlock]; + + /// 如果没有在加载则开始加载 + if (self.isLoadEffect == NO) { + /// 更改加载状态标记 + self.isLoadEffect = YES; + [self loadStartSVGAPlayer]; + } + }); +} +-(void)stopPlay{ +// [self removeSvgaQueueData]; + self.isLoadEffect = NO; + [self.svagView stopEffectSvgaPlay]; + // [self.playerView stop]; + [self.playerMp4View stopHWDMP4]; + // [self.alphaVideoView stop]; + self.playerMp4View.hidden = YES; + self.svagView.hidden = YES; + +} + +-(void)startPlay{ + [self loadStartSVGAPlayer]; +} +-(void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container{ + dispatch_async(dispatch_get_main_queue(), ^{ + self.playerMp4View.hidden = YES; + }); + dispatch_async(dispatch_get_main_queue(), ^{ + [self hideEffect]; + [self loadStartSVGAPlayer]; + }); +} +-(void)viewDidFailPlayMP4:(NSError *)error{ + + dispatch_async(dispatch_get_main_queue(), ^{ + self.playerMp4View.hidden = YES; + }); + dispatch_async(dispatch_get_main_queue(), ^{ + [self hideEffect]; + [self loadStartSVGAPlayer]; + }); +} +- (void)loadStartSVGAPlayer { + NSString *play_image = nil; + /// list加锁 + [self.lock lock]; + /// 如果list长度大于0 + if (self.dataArray.count > 0) { + /// gift的实体类则赋值,取list中的第一个数据 + QXRoomChatListModel *model = self.dataArray.firstObject; + play_image = model.rights_icon; + self.playModel = model; + /// 移除list的第一条数据 + [self.dataArray removeObjectAtIndex:0]; + self.isLoadEffect = YES; + }else { + self.isLoadEffect = NO; + } + /// 解锁 + [self.lock unlock]; + if (self.isLoadEffect && [play_image isExist]) { + dispatch_async(dispatch_get_main_queue(), ^{ + if ([play_image hasSuffix:@"mp4"]) { + __weak typeof(self)weakSelf = self; + /// mp4格式下载播放 + [[QXRequset shareInstance] downloadVideoPlayerWithUrl:play_image completion:^(BOOL result, NSString * _Nonnull fileName) { + if (result) { + NSString *videoPath = [QXFileManager getGiftVideoPath:fileName]; + dispatch_async(dispatch_get_main_queue(), ^{ + weakSelf.playerMp4View.hidden = NO; + weakSelf.svagView.hidden = YES; +// [weakSelf showEffect]; + [weakSelf performSelector:@selector(showEffect) afterDelay:0.5]; + }); + [weakSelf.playerMp4View stopHWDMP4]; + [weakSelf.playerMp4View playHWDMP4:videoPath delegate:self]; + }else{ + [weakSelf loadStartSVGAPlayer]; + } + }]; + }else if ([play_image hasSuffix:@"svg"] || [play_image hasSuffix:@"svga"]) { + __weak typeof(self)weakSelf = self; + /// svga下载播放 + [[QXRequset shareInstance] downloadVideoPlayerWithUrl:play_image completion:^(BOOL result, NSString * _Nonnull fileName) { + if (result) { + dispatch_async(dispatch_get_main_queue(), ^{ + weakSelf.playerMp4View.hidden = YES; + weakSelf.svagView.hidden = NO; + }); + NSString *filePath = [QXFileManager getGiftVideoPath:fileName]; + [weakSelf.svagView loadSVGAPlayerWith:filePath]; + }else{ + [weakSelf loadStartSVGAPlayer]; + } + }]; + }else { + [self.lock lock]; + self.isLoadEffect = NO; + [self.lock unlock]; + [self loadStartSVGAPlayer]; + } + }); + } +} +- (void)loadEndSvgaPlayer { + dispatch_async(self.queue, ^{ + [self hideEffect]; + [self loadStartSVGAPlayer]; + }); +} +- (void)destroyEffectView { + [self removeSvgaQueueData]; + + [self.svagView destroySvga]; +// [self.playerView destroyPlayer]; + [self.playerMp4View stopHWDMP4]; + + [self.svagView removeFromSuperview]; + [self.playerMp4View removeFromSuperview]; + [self.leftHeadeView removeFromSuperview]; + [self.rightHeadeView removeFromSuperview]; + _svagView = nil; +// _playerView = nil; + _playModel = nil; + _playerMp4View = nil; +// _alphaVideoView = nil; +} +- (void)removeSvgaQueueData { + [self.lock lock]; + [self.dataArray removeAllObjects]; + self.isLoadEffect = NO; + [self.lock unlock]; +} + + +-(void)showEffect{ + self.leftHeadeView.hidden = NO; + self.rightHeadeView.hidden = NO; + [self.leftHeadeView setHeadIcon:self.playModel.FromUserInfo.avatar dress:self.playModel.FromUserInfo.dress]; + [self.rightHeadeView setHeadIcon:self.playModel.ToUserInfo.avatar dress:self.playModel.ToUserInfo.avatar]; +// [self.bgView mas_updateConstraints:^(MASConstraintMaker *make) { +// make.top.mas_equalTo(SCREEN_HEIGHT); +// }]; + [self.leftHeadeView startSimpleFloat]; + [self.rightHeadeView startSimpleFloat]; + self.bgView.top = SCREEN_HEIGHT; + self.bgView.alpha = 1; + [UIView animateWithDuration:0.3 animations:^{ + self.bgView.top = 0; + }]; +} + +-(void)hideEffect{ + self.bgView.alpha = 0; +// [self.bgView mas_updateConstraints:^(MASConstraintMaker *make) { +// make.top.mas_equalTo(SCREEN_HEIGHT); +// }]; + self.bgView.top = SCREEN_HEIGHT; + self.leftHeadeView.hidden = YES; + self.rightHeadeView.hidden = YES; + [self.leftHeadeView stopSimpleFloat]; + [self.rightHeadeView stopSimpleFloat]; +} + +- (QXEffectSvgaView *)svagView { + if (!_svagView) { + _svagView = [[QXEffectSvgaView alloc] initWithFrame:CGRectZero isAutoPlay:YES]; +// __weak typeof(self)weakSelf = self; + _svagView.didFinishedDisplay = ^(QXEffectSvgaView * _Nonnull svgaView) { + [svgaView destroySvga]; + }; + } + return _svagView; +} +-(VAPView *)playerMp4View{ + if (!_playerMp4View) { + _playerMp4View = [[VAPView alloc] initWithFrame:CGRectZero]; + _playerMp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypeStop; + _playerMp4View.contentMode = UIViewContentModeScaleAspectFit; + _playerMp4View.userInteractionEnabled = NO; + _playerMp4View.backgroundColor = [UIColor clearColor]; +// _playerMp4View.hwd_Delegate = self; + } + return _playerMp4View; +} +-(NSMutableArray *)dataArray{ + if (!_dataArray) { + _dataArray = [NSMutableArray array]; + } + return _dataArray; +} + +@end diff --git a/QXLive/Room(房间)/View/礼物特效/QXGiftPlayerManager.h b/QXLive/Room(房间)/View/礼物特效/QXGiftPlayerManager.h index d3a9b0f..ff344b0 100644 --- a/QXLive/Room(房间)/View/礼物特效/QXGiftPlayerManager.h +++ b/QXLive/Room(房间)/View/礼物特效/QXGiftPlayerManager.h @@ -8,6 +8,7 @@ #import #import "UIView+VAP.h" #import "QXGiftModel.h" +#import "QXCPEffectView.h" NS_ASSUME_NONNULL_BEGIN @class QXEffectContentView; @interface QXGiftPlayerManager : NSObject @@ -17,9 +18,13 @@ NS_ASSUME_NONNULL_BEGIN - (QXEffectContentView *)defaultFullEffectView; /// 坐骑【公屏信息流位置】特效 - (QXEffectContentView *)defaultChatEffectView; +/// CP 特效 +- (QXCPEffectView *)defaultCpEffectView; /// 礼物、坐骑【全屏位置】特效 加载 - (void)displayFullEffectView:(NSString *)gift; +/// cp 特效 +- (void)displayCpEffectView:(QXRoomChatListModel *)model; /// 礼物数组 - (void)displayFullEffectViewWithMorePlayImages:(NSArray *)playImages; diff --git a/QXLive/Room(房间)/View/礼物特效/QXGiftPlayerManager.m b/QXLive/Room(房间)/View/礼物特效/QXGiftPlayerManager.m index e2d64c8..fc80f1e 100644 --- a/QXLive/Room(房间)/View/礼物特效/QXGiftPlayerManager.m +++ b/QXLive/Room(房间)/View/礼物特效/QXGiftPlayerManager.m @@ -21,6 +21,8 @@ static NSString *PLAY_IMAGE = @"play_image"; // 坐骑【公屏信息流位置】特效 @property (nonatomic,strong) QXEffectContentView *chatEffectView; +@property (nonatomic,strong) QXCPEffectView *cpEffectView; + @end @implementation QXGiftPlayerManager @@ -126,6 +128,12 @@ static NSString *PLAY_IMAGE = @"play_image"; return self.chatEffectView; } +-(QXCPEffectView *)defaultCpEffectView{ + return self.cpEffectView; +} +-(void)displayCpEffectView:(QXRoomChatListModel *)model{ + [self.cpEffectView displayCpEffectUrl:model]; +} - (void)displayFullEffectView:(NSString *)gift { // [self insertGiftWithPlayImage:gift]; [self.fullEffectView displayEffectView:gift]; @@ -148,22 +156,27 @@ static NSString *PLAY_IMAGE = @"play_image"; - (void)destroyEffectSvga { [self.fullEffectView destroyEffectView]; [self.chatEffectView destroyEffectView]; + [self.cpEffectView destroyEffectView]; [self.fullEffectView removeFromSuperview]; [self.chatEffectView removeFromSuperview]; + [self.cpEffectView removeFromSuperview]; [self.bgEffectView removeFromSuperview]; _fullEffectView = nil; _chatEffectView = nil; + _cpEffectView = nil; _bgEffectView = nil; } -(void)stopPlay{ [self.fullEffectView stopPlay]; [self.chatEffectView stopPlay]; + [self.cpEffectView stopPlay]; } -(void)startPlay{ [self.fullEffectView startPlay]; [self.chatEffectView startPlay]; + [self.cpEffectView startPlay]; } - (UIView *)bgEffectView { if (!_bgEffectView) { @@ -172,6 +185,7 @@ static NSString *PLAY_IMAGE = @"play_image"; [_bgEffectView addSubview:self.fullEffectView]; [_bgEffectView addSubview:self.chatEffectView]; + [_bgEffectView addSubview:self.cpEffectView]; } return _bgEffectView; } @@ -197,6 +211,19 @@ static NSString *PLAY_IMAGE = @"play_image"; } return _chatEffectView; } +-(QXCPEffectView *)cpEffectView{ + if (!_cpEffectView) { + _cpEffectView = [[QXCPEffectView alloc] initWithFrame:CGRectZero]; +// [_cpEffectView.playerMp4View mas_remakeConstraints:^(MASConstraintMaker *make) { +//// make.centerX.centerY.equalTo(_chatEffectView); +//// make.width.mas_equalTo(ScaleWidth(375)); +//// make.height.mas_equalTo(ScaleWidth(375)); +// make.edges.equalTo(_cpEffectView); +// }]; + _cpEffectView.queue = dispatch_queue_create("qx_room_cp_svga_message.com", NULL); + } + return _cpEffectView; +} @end @@ -336,7 +363,6 @@ static NSString *PLAY_IMAGE = @"play_image"; [self loadStartSVGAPlayer]; } -(void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container{ - dispatch_async(dispatch_get_main_queue(), ^{ self.playerMp4View.hidden = YES; }); diff --git a/QXLive/Room(房间)/View/签约房/QXSignCoinCell.h b/QXLive/Room(房间)/View/签约房/QXSignCoinCell.h new file mode 100644 index 0000000..a32c3fc --- /dev/null +++ b/QXLive/Room(房间)/View/签约房/QXSignCoinCell.h @@ -0,0 +1,18 @@ +// +// QXSignCoinCell.h +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import +#import "QXRoomRelationModel.h" +NS_ASSUME_NONNULL_BEGIN + +@interface QXSignCoinCell : UICollectionViewCell +@property (weak, nonatomic) IBOutlet UIButton *priceBtn; +@property (weak, nonatomic) IBOutlet UIButton *bgBtn; +@property (nonatomic,strong)QXRoomRelationModel *model; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/签约房/QXSignCoinCell.m b/QXLive/Room(房间)/View/签约房/QXSignCoinCell.m new file mode 100644 index 0000000..af9b26d --- /dev/null +++ b/QXLive/Room(房间)/View/签约房/QXSignCoinCell.m @@ -0,0 +1,20 @@ +// +// QXSignCoinCell.m +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXSignCoinCell.h" + +@implementation QXSignCoinCell +-(void)setModel:(QXRoomRelationModel *)model{ + _model = model; + [self.priceBtn setTitle:model.name forState:(UIControlStateNormal)]; +} +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +@end diff --git a/QXLive/Room(房间)/View/签约房/QXSignCoinCell.xib b/QXLive/Room(房间)/View/签约房/QXSignCoinCell.xib new file mode 100644 index 0000000..fc2b168 --- /dev/null +++ b/QXLive/Room(房间)/View/签约房/QXSignCoinCell.xib @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QXLive/Room(房间)/View/签约房/QXSignCoinListView.h b/QXLive/Room(房间)/View/签约房/QXSignCoinListView.h new file mode 100644 index 0000000..ce058f2 --- /dev/null +++ b/QXLive/Room(房间)/View/签约房/QXSignCoinListView.h @@ -0,0 +1,27 @@ +// +// QXSignCoinListView.h +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@protocol QXSignCoinListViewDelegate + +@optional +-(void)coinListDidClickRecharge; +-(void)coinListDidSignWithCoin:(NSString*)coin; + +@end +@interface QXSignCoinListView : UIView +@property (nonatomic,strong)NSString *signId; +@property (nonatomic,weak)iddelegate; +@property (nonatomic,strong)QXRoomPitModel *pitModel; +-(void)refreshCoinList; +-(void)showInView:(UIView *)view; +-(void)hide; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/签约房/QXSignCoinListView.m b/QXLive/Room(房间)/View/签约房/QXSignCoinListView.m new file mode 100644 index 0000000..cc0551c --- /dev/null +++ b/QXLive/Room(房间)/View/签约房/QXSignCoinListView.m @@ -0,0 +1,252 @@ +// +// QXSignCoinListView.m +// QXLive +// +// Created by 启星 on 2025/11/26. +// + +#import "QXSignCoinListView.h" +#import "QXSignCoinCell.h" +#import "QXMineNetwork.h" + +@interface QXSignCoinListView() +@property (nonatomic,strong)UIView *bgView; + +@property (nonatomic,strong)UIView *topView; +@property (nonatomic,strong)UILabel *topLeftLabel; +@property (nonatomic,strong)UIImageView *headerView; +@property (nonatomic,strong)UILabel *topNicknameLabel; +@property (nonatomic,strong)UILabel *topDescLabel; + +@property (nonatomic,strong)UICollectionView *collectionView; + +@property (nonatomic,strong)UIView *bottomView; +@property (nonatomic,strong)UIImageView *coinImageView; +@property (nonatomic,strong)UILabel *coinLabel; +@property (nonatomic,strong)UIButton *rechargeBtn; +@property (nonatomic,strong)QXRoomRelationModel*selectedModel; +@property (nonatomic,strong)NSMutableArray *dataArray; +@property (nonatomic,strong)NSString* coin; +@end + +@implementation QXSignCoinListView +- (instancetype)init +{ + self = [super init]; + if (self) { + self.frame = UIScreen.mainScreen.bounds; + [self initSubviews]; + } + return self; +} + + +-(void)initSubviews{ + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)]; + self.backgroundColor = RGB16A(0x000000, 0.3); + tap.delegate = self; + [self addGestureRecognizer:tap]; + + self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(410)+kSafeAreaBottom)]; + self.bgView.backgroundColor = RGB16(0x103E30); + [self.bgView addRoundedCornersWithRadius:14 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)]; + [self addSubview:self.bgView]; + + self.topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, 77)]; + [self.bgView addSubview:self.topView]; + + self.topLeftLabel = [[UILabel alloc] init]; + self.topLeftLabel.font = [UIFont systemFontOfSize:12]; + self.topLeftLabel.textColor = RGB16A(0xffffff,0.45); + self.topLeftLabel.text = @"竞拍"; + [self.topView addSubview:self.topLeftLabel]; + [self.topLeftLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(16); + make.centerY.equalTo(self.topView); + }]; + + self.headerView = [[UIImageView alloc] init]; + self.headerView.contentMode = UIViewContentModeScaleAspectFill; + [self.headerView addRoundedCornersWithRadius:25]; + self.headerView.layer.borderColor = RGB16(0xffffff).CGColor; + self.headerView.layer.borderWidth = 2; + [self.topView addSubview:self.headerView]; + [self.headerView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(50); + make.centerY.equalTo(self.topLeftLabel); + make.left.equalTo(self.topLeftLabel.mas_right).offset(2); + }]; + + self.topNicknameLabel = [[UILabel alloc] init]; + self.topNicknameLabel.font = [UIFont systemFontOfSize:12]; + self.topNicknameLabel.textColor = RGB16(0xffffff); + [self.topView addSubview:self.topNicknameLabel]; + [self.topNicknameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.headerView.mas_right).offset(4); + make.centerY.equalTo(self.topLeftLabel); + }]; + + self.topDescLabel = [[UILabel alloc] init]; + self.topDescLabel.font = [UIFont systemFontOfSize:12]; + self.topDescLabel.textColor = RGB16(0xffffff); + self.topDescLabel.numberOfLines = 0; + self.topDescLabel.text = @"如果没有成功拍下ta,金币将退回给您"; + [self.topView addSubview:self.topDescLabel]; + [self.topDescLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-16); + make.width.mas_equalTo(ScaleWidth(135)); + make.centerY.equalTo(self.topLeftLabel); + }]; + + self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, self.bgView.height-kSafeAreaBottom-32, self.bgView.width, 32)]; + [self.bgView addSubview:self.bottomView]; + + self.coinImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_live_gift_corn"]]; + [self.bottomView addSubview:self.coinImageView]; + [self.coinImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(16); + make.width.height.mas_equalTo(14); + make.centerY.equalTo(self.bottomView); + }]; + + + self.coinLabel = [[UILabel alloc] init]; + self.coinLabel.font = [UIFont systemFontOfSize:12]; + self.coinLabel.textColor = RGB16(0xffffff); + self.coinLabel.numberOfLines = 0; + self.coinLabel.text = @"0"; + [self.bottomView addSubview:self.coinLabel]; + [self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.coinImageView.mas_right); + make.centerY.equalTo(self.coinImageView); + }]; + + self.rechargeBtn = [[UIButton alloc] init]; + [self.rechargeBtn setTitle:@"充值" forState:(UIControlStateNormal)]; + self.rechargeBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.rechargeBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)]; + self.rechargeBtn.backgroundColor = QXConfig.themeColor; + [self.rechargeBtn addRoundedCornersWithRadius:16]; + [self.rechargeBtn addTarget:self action:@selector(rechargeAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.bottomView addSubview:self.rechargeBtn]; + [self.rechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-16); + make.height.mas_equalTo(32); + make.width.mas_equalTo(60); + make.centerY.equalTo(self.bottomView); + }]; + + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 12; + layout.minimumInteritemSpacing = 12; + layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16); + layout.itemSize = CGSizeMake((SCREEN_WIDTH-16*2-12*3)/4, ScaleWidth(119)); + layout.scrollDirection = UICollectionViewScrollDirectionVertical; + self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.topView.bottom+10, self.bgView.width, self.bottomView.top-self.topView.bottom-20) collectionViewLayout:layout]; + [self.collectionView registerNib:[UINib nibWithNibName:@"QXSignCoinCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXSignCoinCell"]; + self.collectionView.delegate = self; + self.collectionView.dataSource = self; + self.collectionView.showsHorizontalScrollIndicator = NO; + self.collectionView.showsVerticalScrollIndicator = NO; + self.collectionView.bounces = NO; + self.collectionView.backgroundColor = [UIColor clearColor]; + [self.bgView addSubview:self.collectionView]; +} + +-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ + return touch.view == self; +} + +-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return self.dataArray.count; +} +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + QXSignCoinCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXSignCoinCell" forIndexPath:indexPath]; + cell.model = self.dataArray[indexPath.row]; + return cell; +} + +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ + if (self.delegate && [self.delegate respondsToSelector:@selector(coinListDidSignWithCoin:)]) { + QXRoomRelationModel *md = self.dataArray[indexPath.row]; + [self.delegate coinListDidSignWithCoin:md.name]; + } +} +-(void)rechargeAction{ + if (self.delegate && [self.delegate respondsToSelector:@selector(coinListDidClickRecharge)]) { + [self.delegate coinListDidClickRecharge]; + } +} +-(void)setSignId:(NSString *)signId{ + _signId = signId; + [self getCoinList]; +} +-(void)getMyWallet{ + MJWeakSelf + [QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) { + weakSelf.coinLabel.text = coin; + weakSelf.coin = coin; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; + self.rechargeBtn.hidden = !QXGlobal.shareGlobal.isOpenRecharge; +} +-(void)setPitModel:(QXRoomPitModel *)pitModel{ + _pitModel = pitModel; + [self.headerView sd_setImageWithURL:[NSURL URLWithString:pitModel.avatar]]; + self.topNicknameLabel.text = pitModel.nickname; +} +-(void)getCoinList{ + MJWeakSelf + self.selectedModel = nil; + [self.collectionView reloadData]; + [QXMineNetwork signCoinListWithSignId:self.signId successBlock:^(NSArray * _Nonnull list) { + [weakSelf.dataArray removeAllObjects]; + for (NSString*title in list) { + QXRoomRelationModel *md = [[QXRoomRelationModel alloc] init]; + md.name = title; + [weakSelf.dataArray addObject:md]; + } + [weakSelf.collectionView reloadData]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} + +-(void)refreshCoinList{ + [self getCoinList]; +} +-(void)showInView:(UIView *)view{ + [self getCoinList]; + [self getMyWallet]; + self.bgView.y = SCREEN_HEIGHT; + [view addSubview:self]; + [UIView animateWithDuration:0.3 animations:^{ + self.bgView.y = SCREEN_HEIGHT-ScaleWidth(410)-kSafeAreaBottom; + }]; +} +-(void)hide{ + if (!self.superview) { + NSLog(@"⚠️ View already removed from superview"); + return; + } + [UIView animateWithDuration:0.3 animations:^{ + if (self.bgView) { + self.bgView.y = SCREEN_HEIGHT; + } + } completion:^(BOOL finished) { + // 检查是否已经被移除 + if (self.superview) { + [self removeFromSuperview]; + } + // 避免在 dealloc 过程中访问其他属性 + // 不要在 completion block 中访问或设置其他属性 + }]; +} +-(NSMutableArray *)dataArray{ + if (!_dataArray) { + _dataArray = [NSMutableArray array]; + } + return _dataArray; +} +@end diff --git a/QXLive/Room(房间)/View/签约房/QXSignShowTimeView.h b/QXLive/Room(房间)/View/签约房/QXSignShowTimeView.h new file mode 100644 index 0000000..12c9a72 --- /dev/null +++ b/QXLive/Room(房间)/View/签约房/QXSignShowTimeView.h @@ -0,0 +1,18 @@ +// +// QXSignShowTimeView.h +// QXLive +// +// Created by 启星 on 2025/11/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface QXSignShowTimeView : UIView +@property (nonatomic,strong)NSString *roomId; +-(void)showInView:(UIView *)view; +-(void)hide; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/签约房/QXSignShowTimeView.m b/QXLive/Room(房间)/View/签约房/QXSignShowTimeView.m new file mode 100644 index 0000000..2b516b3 --- /dev/null +++ b/QXLive/Room(房间)/View/签约房/QXSignShowTimeView.m @@ -0,0 +1,196 @@ +// +// QXSignShowTimeView.m +// QXLive +// +// Created by 启星 on 2025/11/25. +// + +#import "QXSignShowTimeView.h" +#import "QXSelectAuctionInfoView.h" +#import "QXMineNetwork.h" + +@interface QXSignShowTimeView() +@property (nonatomic,strong)UIView *bgView; +@property (nonatomic,strong)UILabel *titleLabel; +@property (nonatomic,strong)UICollectionView *collectionView; +@property (nonatomic,strong)UIButton *commitBtn; +@property (nonatomic,strong)UIButton *cancelBtn; +@property (nonatomic,strong)NSMutableArray *dataArray; +@property (nonatomic,strong)QXRoomRelationModel *selectedModel; +@end +@implementation QXSignShowTimeView +- (instancetype)init +{ + self = [super init]; + if (self) { + self.frame = UIScreen.mainScreen.bounds; + [self initSubviews]; + } + return self; +} + +-(void)initSubviews{ + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)]; + self.backgroundColor = RGB16A(0x000000, 0.3); + tap.delegate = self; + [self addGestureRecognizer:tap]; + + self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(310)+kSafeAreaBottom)]; + self.bgView.backgroundColor = RGB16(0xffffff); + [self.bgView addRoundedCornersWithRadius:14 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)]; + [self addSubview:self.bgView]; + + // self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bgView.width, self.bgView.height)]; + // self.bgImageView.image = [UIImage imageNamed:@"room_sound_bg"]; + // [self.bgView addSubview:self.bgImageView]; + + + self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 16, self.bgView.width-32, 24)]; + self.titleLabel.font = [UIFont systemFontOfSize:16]; + self.titleLabel.textColor = RGB16(0x333333); + self.titleLabel.textAlignment = NSTextAlignmentLeft; + self.titleLabel.text = @"展示才艺"; + [self.bgView addSubview:self.titleLabel]; + + self.cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.bgView.height-kSafeAreaBottom-12-42, 95, 42)]; + [self.cancelBtn setTitle:@"取消" forState:(UIControlStateNormal)]; + self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.cancelBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)]; + self.cancelBtn.backgroundColor = RGB16(0x333333); + [self.cancelBtn addRoundedCornersWithRadius:21]; + [self.cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.bgView addSubview:self.cancelBtn]; + + self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.cancelBtn.right+16, self.bgView.height-kSafeAreaBottom-12-42, self.bgView.width-self.cancelBtn.right-16-38, 42)]; + [self.commitBtn setTitle:@"确定" forState:(UIControlStateNormal)]; + self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)]; + self.commitBtn.backgroundColor = QXConfig.themeColor; + [self.commitBtn addRoundedCornersWithRadius:21]; + [self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.bgView addSubview:self.commitBtn]; + + + + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 12; + layout.minimumInteritemSpacing = 12; + layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16); + NSInteger itemWidth = (SCREEN_WIDTH-16*2-12*3)/4; + layout.itemSize = CGSizeMake(itemWidth, 44); + layout.scrollDirection = UICollectionViewScrollDirectionVertical; + self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom, self.bgView.width, self.commitBtn.top-self.titleLabel.bottom-10) collectionViewLayout:layout]; + [self.collectionView registerClass:[QXSelectAuctionInfoCell class] forCellWithReuseIdentifier:@"QXSelectAuctionInfoCell"]; + self.collectionView.delegate = self; + self.collectionView.dataSource = self; + self.collectionView.showsHorizontalScrollIndicator = NO; + self.collectionView.showsVerticalScrollIndicator = NO; + self.collectionView.bounces = NO; + self.collectionView.backgroundColor = [UIColor clearColor]; + [self.bgView addSubview:self.collectionView]; +} +-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ + return touch.view == self; +} +-(void)setRoomId:(NSString *)roomId{ + _roomId = roomId; +} +-(void)commitAction{ + if (self.selectedModel == nil) { + showToast(@"请选择您要展示的才艺"); + return; + } + + [[QXRoomMessageManager shared] sendChatMessage:[NSString stringWithFormat:@"选择的才艺是 %@",self.selectedModel.name] messageType:(QXRoomMessageTypeText) needInsertMessage:YES]; +} + +-(void)getPlayList{ + MJWeakSelf + [QXMineNetwork signGeyPlayListSuccessBlock:^(NSArray * _Nonnull list) { + [weakSelf.dataArray removeAllObjects]; + for (NSString*title in list) { + QXRoomRelationModel *md = [[QXRoomRelationModel alloc] init]; + md.name = title; + [weakSelf.dataArray addObject:md]; + } + [weakSelf.collectionView reloadData]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} + +-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return self.dataArray.count; +} +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + QXSelectAuctionInfoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXSelectAuctionInfoCell" forIndexPath:indexPath]; + cell.timeModel = self.dataArray[indexPath.row]; + return cell; +} +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ + QXRoomRelationModel *model = self.dataArray[indexPath.row]; + if (model.isSelected) { + return; + } + self.selectedModel.isSelected = NO; + model.isSelected = YES; + self.selectedModel = model; + [collectionView reloadData]; +} +-(void)cancelAction{ + [self hide]; +} +-(void)showInView:(UIView *)view{ + self.selectedModel = nil; + [self.collectionView reloadData]; + [self getPlayList]; + self.bgView.y = SCREEN_HEIGHT; + [view addSubview:self]; + [UIView animateWithDuration:0.3 animations:^{ + self.bgView.y = SCREEN_HEIGHT-ScaleWidth(310)-kSafeAreaBottom; + }]; +} +-(void)hide{ + if (!self.superview) { + NSLog(@"⚠️ View already removed from superview"); + return; + } + [UIView animateWithDuration:0.3 animations:^{ + if (self.bgView) { + self.bgView.y = SCREEN_HEIGHT; + } + } completion:^(BOOL finished) { + // 检查是否已经被移除 + if (self.superview) { + [self removeFromSuperview]; + } + // 避免在 dealloc 过程中访问其他属性 + // 不要在 completion block 中访问或设置其他属性 + }]; +} +-(NSMutableArray *)dataArray{ + if (!_dataArray) { + _dataArray = [NSMutableArray array]; +// QXRoomRelationModel *md = [[QXRoomRelationModel alloc] init]; +// md.name = @"唱歌"; +// [_dataArray addObject:md]; +// +// QXRoomRelationModel *md1 = [[QXRoomRelationModel alloc] init]; +// md1.name = @"唱歌"; +// [_dataArray addObject:md1]; +// +// QXRoomRelationModel *md2 = [[QXRoomRelationModel alloc] init]; +// md2.name = @"唱歌"; +// [_dataArray addObject:md2]; +// +// QXRoomRelationModel *md3 = [[QXRoomRelationModel alloc] init]; +// md3.name = @"唱歌"; +// [_dataArray addObject:md3]; +// +// QXRoomRelationModel *md4 = [[QXRoomRelationModel alloc] init]; +// md4.name = @"唱歌"; +// [_dataArray addObject:md4]; + } + return _dataArray; +} +@end diff --git a/QXLive/Room(房间)/View/设置/QXRoomSettingView.h b/QXLive/Room(房间)/View/设置/QXRoomSettingView.h index c5657ea..1871002 100644 --- a/QXLive/Room(房间)/View/设置/QXRoomSettingView.h +++ b/QXLive/Room(房间)/View/设置/QXRoomSettingView.h @@ -26,6 +26,8 @@ typedef NS_ENUM(NSInteger) { QXRoomSettingTypeRoomTypeKSing = 200, /// 点唱房 QXRoomSettingTypeRoomTypeSinger = 300, + /// 签约房 + QXRoomSettingTypeRoomTypeSign = 400, /// 常用工具 /// 房间补贴 diff --git a/QXLive/Room(房间)/View/设置/QXRoomSettingView.m b/QXLive/Room(房间)/View/设置/QXRoomSettingView.m index 9630a20..bf16d65 100644 --- a/QXLive/Room(房间)/View/设置/QXRoomSettingView.m +++ b/QXLive/Room(房间)/View/设置/QXRoomSettingView.m @@ -46,6 +46,8 @@ @property (nonatomic,strong)QXRoomSettingModel *roomTypeKSing; /// 练歌房 @property (nonatomic,strong)QXRoomSettingModel *roomTypeSinger; +/// 签约房 +@property (nonatomic,strong)QXRoomSettingModel *roomTypeSign; @@ -176,7 +178,7 @@ NSArray *roomTypeArr; NSArray *toolsArr; NSArray *moreArr; - roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFriend,self.roomTypeKSing,self.roomTypeSinger]; + roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFriend,self.roomTypeKSing,self.roomTypeSinger,self.roomTypeSign]; switch (roleType) { // 主持 case QXRoomRoleTypeCompere:{ @@ -331,7 +333,8 @@ || model.type == QXRoomSettingTypeRoomTypeFriend || model.type == QXRoomSettingTypeRoomTypeFunny || model.type == QXRoomSettingTypeRoomTypeKSing - || model.type == QXRoomSettingTypeRoomTypeSinger) { + || model.type == QXRoomSettingTypeRoomTypeSinger + || model.type == QXRoomSettingTypeRoomTypeSign) { self.alertView.message = [NSString stringWithFormat:@"您确定要修改为%@房吗?",model.name]; [[QXGlobal shareGlobal] showView:self.alertView controller:self.viewController popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{ @@ -372,7 +375,10 @@ type = @"8"; }else if (roomType == QXRoomSettingTypeRoomTypeSinger) { type = @"9"; + }else if (roomType == QXRoomSettingTypeRoomTypeSign) { + type = @"10"; } + [QXMineNetwork changeRoomTypeWithRoomId:self.roomModel.room_info.room_id type:type successBlock:^(NSDictionary * _Nonnull dict) { } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { @@ -470,6 +476,16 @@ return _roomTypeSinger; } +-(QXRoomSettingModel *)roomTypeSign{ + if (!_roomTypeSign) { + _roomTypeSign = [[QXRoomSettingModel alloc] init]; + _roomTypeSign.name = QXText(@"签约"); + _roomTypeSign.type = QXRoomSettingTypeRoomTypeSign; + _roomTypeSign.icon = @"room_set_room_type_sign"; + } + return _roomTypeSign; +} + -(QXRoomSettingModel *)roomSubsidy{ if (!_roomSubsidy) { _roomSubsidy = [[QXRoomSettingModel alloc] init]; diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeFrientView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeFrientView.m index 0b193ec..89e542c 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeFrientView.m +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeFrientView.m @@ -1404,6 +1404,10 @@ _heartTopLineParser = nil; _heartCenterLineParser = nil; _heartBottomLineParser = nil; + if (_timer) { + [_timer invalidate]; + _timer = nil; + } } @end diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.h b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.h new file mode 100644 index 0000000..40ca4e7 --- /dev/null +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.h @@ -0,0 +1,53 @@ +// +// QXRoomSeatTypeSignView.h +// QXLive +// +// Created by 启星 on 2025/11/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface QXRoomSeatTypeSignView : UIView +@property (nonatomic,weak)iddelegate; +@property (nonatomic,strong)QXRoomModel *roomModel; +/// seatArray +@property (nonatomic,strong,readonly)NSMutableArray *seatArray; +@property (nonatomic,assign)NSInteger myPitNumber; +@property (nonatomic,strong)QXRoomSeatContentView* mySeatView; + +/// 上下麦 +-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number isPK:(BOOL)isPK; +/// 清除魅力 +-(void)clearCharm; +/// 清除个人魅力 +-(void)roomClearUserCharmWithUserId:(NSString *)userId; +/// 设置魅力 +-(void)setSeatCharmWithUser:(QXUserHomeModel *)model; +/// 设置多人魅力 +-(void)setSeatCharmWithUsers:(NSArray*)users; + +/// 房间内用户信息发生变化 +-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user; + +/// 房间内换麦 +-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber userInfo:(QXUserHomeModel*)userInfo isPK:(BOOL)isPK; + + +/// 签约开始 +-(void)signDidStartWithEndTime:(NSString *)endTime signId:(NSString *)signId signDay:(NSString*)signDay signValue:(NSString*)signValue; +/// 签约结束 +-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value; +/// 签约身价变化 +-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId; +/// 签约发生延时 +-(void)signTimeDelayWithEndTime:(NSString*)endTime; + +-(void)stopHWDMP4; +-(void)playHWDMP4; + +-(void)destroyViews; +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m new file mode 100644 index 0000000..8d58b77 --- /dev/null +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m @@ -0,0 +1,899 @@ +// +// QXRoomSeatTypeSignView.m +// QXLive +// +// Created by 启星 on 2025/11/25. +// + +#import "QXRoomSeatTypeSignView.h" +#import "QXSignShowTimeView.h" +#import "QXSignCoinListView.h" +#import "QXMineNetwork.h" +#import "QXCustomAlertView.h" +#import "QXRechargeView.h" + +@interface QXRoomSeatTypeSignView() +@property (nonatomic,strong)UIImageView *bgImageView; +/// 主持 +@property (nonatomic,strong)QXRoomSeatContentView *compereView; +/// 标题 +@property (nonatomic,strong)UILabel *titleLabel; +/// 帮助按钮 +@property (nonatomic,strong)UIButton *helpBtn; + +@property (nonatomic,strong)UILabel *timeLabel; + +@property (nonatomic,strong)UIButton *delayBtn; +@property (nonatomic,strong)UIButton *endBtn; +@property (nonatomic,strong)UIButton *startBtn; +/// 被签约人 +@property (nonatomic,strong)QXRoomSeatContentView *signView; + +/// 价格视图 +@property (nonatomic,strong)UIView *priceView; +@property (nonatomic,strong)UIView *priceBottomView; +@property (nonatomic,strong)UIImageView *priceTitleImageView; +@property (nonatomic,strong)UIImageView *priceImageView; +@property (nonatomic,strong)UILabel *priceLabel; + +@property (nonatomic,strong)UIImageView *dayImageView; +@property (nonatomic,strong)UILabel *dayLabel; + +/// 申请上麦 +@property (nonatomic,strong)UIButton *applyBtn; +@property (nonatomic,strong)UIButton *signBtn; +@property (nonatomic,strong)UIButton *showTimeBtn; +/// 师傅视图 +@property (nonatomic,strong)UIView *masterView; +@property (nonatomic,strong)UIImageView *masterBgImageView; +@property (nonatomic,strong)QXRoomSeatContentView *masterSeatView; + +/// 老板视图 +@property (nonatomic,strong)UIView *bossView; +@property (nonatomic,strong)UIImageView *bossBgImageView; +@property (nonatomic,strong)QXRoomSeatContentView *bossSeatView1; +@property (nonatomic,strong)QXRoomSeatContentView *bossSeatView2; +@property (nonatomic,strong)QXRoomSeatContentView *bossSeatView3; + +@property (nonatomic,strong)NSMutableArray *seatArray; + + +/// 定时器 +@property (nonatomic,strong)QXTimer *timer; +@property (nonatomic,assign)NSInteger startTime; +@property (nonatomic,strong)UILabel *tenSecondLabel; + +@property (nonatomic,strong)QXSignCoinListView *coinView; +@end + +@implementation QXRoomSeatTypeSignView + +- (instancetype)init +{ + self = [super init]; + if (self) { + [self initSubviews]; + } + return self; +} +-(void)initSubviews{ + self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_content_bg"]]; + self.bgImageView.contentMode = UIViewContentModeScaleToFill; + [self addSubview:self.bgImageView]; + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(10); + make.left.mas_equalTo(16); + make.right.mas_equalTo(-16); + make.height.mas_equalTo(ScaleWidth(315)); + }]; + + self.compereView = [[QXRoomSeatContentView alloc] init]; + self.compereView.delegate = self; + self.compereView.tagString = QXText(@"主持"); + self.compereView.number = 9; + [self addSubview:self.compereView]; + [self.compereView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.bgImageView).offset(5); + make.width.mas_equalTo(ScaleWidth(45)); + make.height.mas_equalTo(ScaleWidth(45-10)+30); + make.left.equalTo(self.bgImageView).offset(5); + }]; + + self.titleLabel = [[UILabel alloc] init]; + self.titleLabel.font = [UIFont fontWithName:@"YouSheBiaoTiHei" size:18]; + self.titleLabel.textColor = RGB16(0xffffff); + self.titleLabel.text = @"签约房"; + [self addSubview:self.titleLabel]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self); + make.top.equalTo(self.bgImageView).offset(8); + make.height.mas_equalTo(20); + }]; + + self.helpBtn = [[UIButton alloc] init]; + [self.helpBtn setImage:[UIImage imageNamed:@"room_auction_help"] forState:(UIControlStateNormal)]; + [self.helpBtn addTarget:self action:@selector(helpAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self addSubview:self.helpBtn]; + [self.helpBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(10); + make.right.mas_equalTo(-15); + make.height.width.mas_equalTo(45); + }]; + + self.timeLabel = [[UILabel alloc] init]; + self.timeLabel.font = [UIFont systemFontOfSize:11]; + self.timeLabel.textColor = RGB16(0xffffff); + self.timeLabel.text = @"倒计时 00:00"; + self.timeLabel.hidden = YES; + [self addSubview:self.timeLabel]; + [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self); + make.top.equalTo(self.titleLabel.mas_bottom); + make.height.mas_equalTo(12); + }]; + + self.startBtn = [[UIButton alloc] init]; + [self.startBtn setTitle:@"开始" forState:(UIControlStateNormal)]; + [self.startBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)]; + self.startBtn.titleLabel.font = [UIFont systemFontOfSize:12]; + [self.startBtn addRoundedCornersWithRadius:ScaleWidth(9)]; + [self.startBtn addTarget:self action:@selector(startAction) forControlEvents:(UIControlEventTouchUpInside)]; + self.startBtn.backgroundColor = QXConfig.themeColor; + self.startBtn.hidden = NO; + [self addSubview:self.startBtn]; + [self.startBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self); + make.top.equalTo(self.titleLabel.mas_bottom); + make.height.mas_equalTo(ScaleWidth(18)); + make.width.mas_equalTo(ScaleWidth(40)); + }]; + + self.delayBtn = [[UIButton alloc] init]; + [self.delayBtn setTitle:@"延时" forState:(UIControlStateNormal)]; + [self.delayBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)]; + self.delayBtn.titleLabel.font = [UIFont systemFontOfSize:12]; + [self.delayBtn addRoundedCornersWithRadius:ScaleWidth(9)]; + [self.delayBtn addTarget:self action:@selector(delayAction) forControlEvents:(UIControlEventTouchUpInside)]; + self.delayBtn.backgroundColor = QXConfig.themeColor; + self.delayBtn.hidden = YES; + [self addSubview:self.delayBtn]; + [self.delayBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.timeLabel.mas_left).offset(-4); + make.height.mas_equalTo(ScaleWidth(18)); + make.width.mas_equalTo(ScaleWidth(40)); + make.centerY.equalTo(self.timeLabel); + }]; + + self.endBtn = [[UIButton alloc] init]; + [self.endBtn setTitle:@"结束" forState:(UIControlStateNormal)]; + [self.endBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)]; + self.endBtn.titleLabel.font = [UIFont systemFontOfSize:12]; + [self.endBtn addTarget:self action:@selector(endAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.endBtn addRoundedCornersWithRadius:ScaleWidth(9)]; + self.endBtn.backgroundColor = RGB16(0x333333); + self.endBtn.hidden = YES; + [self addSubview:self.endBtn]; + [self.endBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.timeLabel.mas_right).offset(4); + make.height.mas_equalTo(ScaleWidth(18)); + make.centerY.equalTo(self.timeLabel); + make.width.mas_equalTo(ScaleWidth(40)); + }]; + + self.signView = [[QXRoomSeatContentView alloc] init]; + self.signView.delegate = self; + self.signView.number = 1; + self.signView.numberString = @"虚位以待"; + [self addSubview:self.signView]; + [self.signView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(ScaleWidth(78)+10-5); + make.width.mas_equalTo(ScaleWidth(55)); + make.height.mas_equalTo(ScaleWidth(55-10)+51); + make.centerX.mas_equalTo(self); + }]; + + self.applyBtn = [[UIButton alloc] init]; + [self.applyBtn addTarget:self action:@selector(applyAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.applyBtn setBackgroundImage:[UIImage imageNamed:@"room_sign_apply_seat"] forState:(UIControlStateNormal)]; + [self addSubview:self.applyBtn]; + [self.applyBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self); + make.width.mas_equalTo(ScaleWidth(83)); + make.height.mas_equalTo(ScaleWidth(28)); + make.top.mas_equalTo(ScaleWidth(152)+10); + }]; + + self.masterView = [[UIView alloc] init]; + [self addSubview:self.masterView]; + [self.masterView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.bgImageView).offset(8); + make.bottom.mas_equalTo(-8); + make.width.mas_equalTo(ScaleWidth(88)); + make.height.mas_equalTo(ScaleWidth(111)); + }]; + + self.masterBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_master_bg"]]; + [self.masterView addSubview:self.masterBgImageView]; + [self.masterBgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.masterView); + }]; + + self.masterSeatView = [[QXRoomSeatContentView alloc] init]; + self.masterSeatView.delegate = self; + self.masterSeatView.number = 2; + self.masterSeatView.numberString = @"虚位以待"; + [self.masterView addSubview:self.masterSeatView]; + [self.masterSeatView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(ScaleWidth(26)); + make.width.mas_equalTo(ScaleWidth(55)); + make.height.mas_equalTo(ScaleWidth(55-10)+30); + make.centerX.equalTo(self.masterView); + }]; + + self.bossView = [[UIView alloc] init]; + [self addSubview:self.bossView]; + [self.bossView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.masterView.mas_right).offset(8); + make.bottom.top.equalTo(self.masterView); + make.right.equalTo(self.bgImageView).offset(-8); + }]; + + self.bossBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_boss_bg"]]; + [self.bossView addSubview:self.bossBgImageView]; + [self.bossBgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.bossView); + }]; + + + self.bossSeatView2 = [[QXRoomSeatContentView alloc] init]; + self.bossSeatView2.delegate = self; + self.bossSeatView2.number = 4; + self.bossSeatView2.numberString = @"虚位以待"; + [self.bossView addSubview:self.bossSeatView2]; + [self.bossSeatView2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(ScaleWidth(32)); + make.centerX.equalTo(self.bossView); + make.width.mas_equalTo(ScaleWidth(55)); + make.height.mas_equalTo(ScaleWidth(55-10)+30); + }]; + + self.bossSeatView1 = [[QXRoomSeatContentView alloc] init]; + self.bossSeatView1.delegate = self; + self.bossSeatView1.number = 3; + self.bossSeatView1.numberString = @"虚位以待"; + [self.bossView addSubview:self.bossSeatView1]; + [self.bossSeatView1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.bossSeatView2.mas_left).offset(-20); + make.centerY.equalTo(self.bossSeatView2); + make.width.mas_equalTo(ScaleWidth(55)); + make.height.mas_equalTo(ScaleWidth(55-10)+30); + }]; + + self.bossSeatView3 = [[QXRoomSeatContentView alloc] init]; + self.bossSeatView3.delegate = self; + self.bossSeatView3.number = 5; + self.bossSeatView3.numberString = @"虚位以待"; + [self.bossView addSubview:self.bossSeatView3]; + [self.bossSeatView3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.bossSeatView2.mas_right).offset(20); + make.centerY.equalTo(self.bossSeatView2); + make.width.mas_equalTo(ScaleWidth(55)); + make.height.mas_equalTo(ScaleWidth(55-10)+30); + }]; + + self.priceView = [[UIView alloc] init]; + [self addSubview:self.priceView]; + [self.priceView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.bgImageView).offset(22); + make.width.mas_equalTo(ScaleWidth(84)); + make.height.mas_equalTo(ScaleWidth(94)); + make.top.mas_equalTo(ScaleWidth(78)+10); + }]; + + self.priceTitleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_title_image"]]; + [self.priceView addSubview:self.priceTitleImageView]; + [self.priceTitleImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self.priceView); + make.width.mas_equalTo(ScaleWidth(56)); + make.height.mas_equalTo(ScaleWidth(15)); + }]; + + self.priceBottomView = [[UIView alloc] init]; + self.priceBottomView.backgroundColor = RGB16A(0x000000,0.4); + [self.priceBottomView addRoundedCornersWithRadius:4]; + [self.priceView insertSubview:self.priceBottomView belowSubview:self.priceTitleImageView]; + [self.priceBottomView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.equalTo(self.priceView); + make.top.mas_equalTo(ScaleWidth(8)); + }]; + + self.priceImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallet_corn"]]; + [self.priceBottomView addSubview:self.priceImageView]; + [self.priceImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self.priceView); + make.width.mas_equalTo(ScaleWidth(40)); + make.height.mas_equalTo(ScaleWidth(40)); + make.top.mas_equalTo(ScaleWidth(20)); + }]; + + self.priceLabel = [[UILabel alloc] init]; + self.priceLabel.font = [UIFont systemFontOfSize:12]; + self.priceLabel.textColor = RGB16(0xffffff); + self.priceLabel.text = @"0"; + [self.priceBottomView addSubview:self.priceLabel]; + [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self.priceBottomView); + make.top.equalTo(self.priceImageView.mas_bottom); + make.height.mas_equalTo(14); + }]; + + self.dayLabel = [[UILabel alloc] init]; + self.dayLabel.font = [UIFont systemFontOfSize:13]; + self.dayLabel.textColor = RGB16(0xffffff); +// self.dayLabel.text = @"签约7天"; + [self addSubview:self.dayLabel]; + [self.dayLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.bgImageView.mas_right).offset(-18); + make.top.equalTo(self.priceView).offset(8); + make.height.mas_equalTo(15); + }]; + + self.dayImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_time_image"]]; + [self addSubview:self.dayImageView]; + [self.dayImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.equalTo(self.dayLabel); + make.width.mas_equalTo(ScaleWidth(13)); + make.height.mas_equalTo(ScaleWidth(13)); + make.right.equalTo(self.dayLabel.mas_left); + }]; + + self.signBtn = [[UIButton alloc] init]; + [self addSubview:self.signBtn]; + self.signBtn.hidden = YES; + [self.signBtn setBackgroundImage:[UIImage imageNamed:@"room_sign_btn"] forState:(UIControlStateNormal)]; + [self.signBtn addTarget:self action:@selector(signAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.signBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.equalTo(self.bossView.mas_top); + make.width.mas_equalTo(ScaleWidth(86)); + make.height.mas_equalTo(ScaleWidth(34)); + make.centerX.equalTo(self); + }]; + + self.showTimeBtn = [[UIButton alloc] init]; + self.showTimeBtn.hidden = YES; + [self addSubview:self.showTimeBtn]; + [self.showTimeBtn setBackgroundImage:[UIImage imageNamed:@"room_sign_show_time"] forState:(UIControlStateNormal)]; + [self.showTimeBtn addTarget:self action:@selector(showTimeAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.showTimeBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.signBtn); + }]; + + [self addSubview:self.tenSecondLabel]; + [self.tenSecondLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.centerY.equalTo(self); + }]; + + /// 1 号麦 + [self.seatArray addObject:self.signView]; + /// 2号麦 + [self.seatArray addObject:self.masterSeatView]; + /// 3号麦 + [self.seatArray addObject:self.bossSeatView1]; + /// 4号麦 + [self.seatArray addObject:self.bossSeatView2]; + /// 5号麦 + [self.seatArray addObject:self.bossSeatView3]; + ///6 号麦 (占位) + [self.seatArray addObject:[QXRoomSeatContentView new]]; + ///7 号麦 (占位) + [self.seatArray addObject:[QXRoomSeatContentView new]]; + ///8 号麦 (占位) + [self.seatArray addObject:[QXRoomSeatContentView new]]; + /// 主持麦 9号麦 + [self.seatArray addObject:self.compereView]; + [self resetviews]; +} + +-(void)resetviews{ + self.signBtn.hidden = YES; + self.showTimeBtn.hidden = YES; + self.priceView.hidden = YES; + self.priceLabel.text = @"0"; + self.endBtn.hidden = YES; + self.timeLabel.hidden = YES; + self.delayBtn.hidden = YES; + + self.applyBtn.hidden = NO; + self.startBtn.hidden = NO; +} + +-(void)setRoomModel:(QXRoomModel *)roomModel{ + _roomModel = roomModel; + for (int i = 0 ; i < roomModel.room_info.pit_list.count;i++) { + QXRoomPitModel *pitModel = roomModel.room_info.pit_list[i]; + if (pitModel.pit_number.intValue == 6 || pitModel.pit_number.intValue == 7 || pitModel.pit_number.intValue == 8 || pitModel.pit_number.intValue > 9) { + continue; + } + QXRoomSeatContentView *contentView = self.seatArray[i]; + contentView.pitModel = pitModel; + if (pitModel.pit_number.intValue == 9 || pitModel.pit_number.intValue == 1) { + continue; + }else{ + [contentView hideCharm]; + } + } + self.priceLabel.text = self.roomModel.sign_info.current_body_value; + self.dayLabel.text = [NSString stringWithFormat:@"签约%@天",self.roomModel.sign_info.sign_day]; + self.myPitNumber = roomModel.user_info.pit_number.integerValue; + [self configStatus]; + if (self.roomModel.sign_info.sign_status.intValue == 1) { + [self startTimer]; + } +} +-(void)configStatus{ + if (self.roomModel.sign_info.sign_status.intValue == 0) { + /// 未开始 + if (self.myPitNumber == 9) { + if (self.signView.pitModel.user_id.longLongValue>0) { + self.startBtn.hidden = NO; + self.endBtn.hidden = YES; + self.delayBtn.hidden = YES; + self.timeLabel.hidden = YES; + }else{ + self.startBtn.hidden = YES; + self.endBtn.hidden = YES; + self.delayBtn.hidden = YES; + self.timeLabel.hidden = YES; + } + }else{ + self.startBtn.hidden = YES; + self.endBtn.hidden = YES; + self.delayBtn.hidden = YES; + self.timeLabel.hidden = YES; + } + self.priceView.hidden = YES; + self.dayImageView.hidden = YES; + self.dayLabel.hidden = YES; + if (self.myPitNumber>0) { + self.applyBtn.hidden = YES; + }else{ + if (self.signView.pitModel.user_id.longLongValue > 0) { + self.applyBtn.hidden = YES; + }else{ + self.applyBtn.hidden = NO; + } + } + self.showTimeBtn.hidden = YES; + self.signBtn.hidden = YES; + }else{ + if (self.myPitNumber == 9 || self.roomModel.user_info.is_host.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1 || self.roomModel.user_info.is_room_owner.intValue == 1) { + self.endBtn.hidden = NO; + self.delayBtn.hidden = NO; + }else{ + self.endBtn.hidden = YES; + self.delayBtn.hidden = YES; + } + self.applyBtn.hidden = YES; + self.startBtn.hidden = YES; + self.timeLabel.hidden = NO; + self.priceView.hidden = NO; + self.dayImageView.hidden = NO; + self.dayLabel.hidden = NO; + [self cofignBtn]; + } + +} + +-(void)cofignBtn{ + if (self.myPitNumber == 1) { + self.showTimeBtn.hidden = NO; + self.signBtn.hidden = YES; + }else{ + self.showTimeBtn.hidden = YES; + self.signBtn.hidden = NO; + } + +} +-(void)helpAction{ + NSString *urlString = [NSString stringWithFormat:@"%@api/Page/page_show?id=%@",ServerUrl,@"32"]; + QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; + vc.urlStr = urlString; + [self.viewController.navigationController pushViewController:vc animated:YES]; +} +-(void)startAction{ + if (self.signView.pitModel.user_id.longLongValue <= 0) { + showToast(@"签约座位暂无人员"); + return; + } + [QXMineNetwork signStartWithRoomId:self.roomModel.room_info.room_id userId:self.signView.pitModel.user_id successBlock:^(NSDictionary * _Nonnull dict) { + + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} +-(void)delayAction{ + [QXMineNetwork signDelayWithSignId:self.roomModel.sign_info.sign_id successBlock:^(NSDictionary * _Nonnull dict) { + + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} +-(void)endAction{ + QXCustomAlertView *alert = [[QXCustomAlertView alloc] init]; + [alert showInView:self.viewController.view title:@"您确定要结束本场签约吗" message:@"" cancleTitle:@"取消" commitTitle:@"确定"]; + + __weak typeof(self) weakSelf = self; + alert.commitBlock = ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated, skipping hide operation"); + return; + } + [strongSelf signEndNetwork]; + }; +} + +-(void)signEndNetwork{ + [QXMineNetwork signEndWithSignId:self.roomModel.sign_info.sign_id successBlock:^(NSDictionary * _Nonnull dict) { + + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} +-(void)applyAction{ + [QXMineNetwork roomUpSeatWithRoomId:self.roomModel.room_info.room_id pit_number:@"1" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) { + + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} +-(void)signAction{ + self.coinView.signId = self.roomModel.sign_info.sign_id; + self.coinView.pitModel = self.signView.pitModel; + [self.coinView showInView:self.viewController.view]; +} + +-(void)coinListDidClickRecharge{ + if (_coinView) { + [_coinView hide]; + } + QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; + recharge.isPop = YES; + [recharge showInView:self.viewController.view]; +} + +-(void)coinListDidSignWithCoin:(NSString *)coin{ + [QXMineNetwork signCoinWithSign_value:coin sign_id:self.roomModel.sign_info.sign_id successBlock:^(NSDictionary * _Nonnull dict) { + + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; +} + +-(void)showTimeAction{ + QXSignShowTimeView *view = [[QXSignShowTimeView alloc] init]; + [view showInView:self.viewController.view]; +} +-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{ + NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ; + QXLOG(@"点击了%ld麦位",seatView.number); + if (seatView.pitModel.user_id.longLongValue > 0) { + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { + [self.delegate didClickUserHeaderWithPitModel:seatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO]; + } + }else{ + if (seatView.number == 9) { + /// 麦位没人时点9号麦直接请求上麦 + [QXMineNetwork roomUpSeatWithRoomId:self.roomModel.room_info.room_id pit_number:pit_number isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) { + + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; + return; + }else if(seatView.number == 2){ + return; + }else if (seatView.number == 1 || seatView.number == 3 || seatView.number == 4 || seatView.number == 5) { + if (self.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1) { + if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) { + [self.delegate didHugSeatWithPitNumber:pitModel.pit_number]; + } + } + return; + }else{ + + } + } + +} +-(void)previewRoomUserCharmListWithUserId:(NSString *)userId{ + if (self.delegate && [self.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) { + [self.delegate previewRoomUserCharmListWithUserId:userId]; + } +} +-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number isPK:(BOOL)isPK{ + if (pit_number > 10 || pit_number == 6 || pit_number == 7 || pit_number == 8) { + return; + } + QXRoomSeatContentView *contentView = self.seatArray[pit_number-1]; + QXRoomPitModel *model = contentView.pitModel; + if (isUpSeat) { + model.user_id = user.user_id; + model.avatar = user.avatar; + model.dress = user.dress; + model.sex = user.sex; + model.nickname = user.nickname; + model.user_code = user.user_code; + model.charm = user.charm; + model.nobility_image = user.nobility_image; + model.nickname_color = user.nickname_color; + model.mic_cycle = user.mic_cycle; + }else{ + model.user_id = @"0"; + model.avatar = @""; + model.dress = @""; + model.sex = @""; + model.nickname = @""; + model.user_code = @""; + model.charm = @""; + model.nobility_image = @""; + model.nickname_color = @""; + model.mic_cycle = @""; + if (contentView.isSeatSpeaking) { + [contentView stopAudioAnimation]; + } + } + if ([user.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) { + if (isUpSeat) { + self.myPitNumber = pit_number; + }else{ + self.myPitNumber = -1; + } + }else{ + + } + contentView.pitModel = model; + if (pit_number == 9 || pit_number == 1) { + + }else{ + [contentView hideCharm]; + } + /// 有人上了1号麦的话中间申请上麦按钮隐藏 + if (pit_number == 1 && isUpSeat) { + self.applyBtn.hidden = YES; + }else{ + self.applyBtn.hidden = NO; + } + [self configStatus]; +} +-(void)clearCharm{ + for (QXRoomSeatContentView *seatView in self.seatArray) { + QXRoomPitModel *model = seatView.pitModel; + model.charm = @"0"; + [seatView updateUserCharm:model.charm]; + } +} +-(void)roomClearUserCharmWithUserId:(NSString *)userId{ + for (QXRoomSeatContentView *seatView in self.seatArray) { + QXRoomPitModel *model = seatView.pitModel; + if ([model.user_id isEqualToString:userId]) { + model.charm = @"0"; + [seatView updateUserCharm:model.charm]; + break; + } + } +} +-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{ + for (QXRoomSeatContentView *seatView in self.seatArray) { + QXRoomPitModel *md = seatView.pitModel; + if ([model.user_id isEqualToString:md.user_id]) { + [seatView updateUserCharm:model.charm]; + break; + } + } +} +-(void)setSeatCharmWithUsers:(NSArray *)users{ + for (QXUserHomeModel*model in users) { + [self setSeatCharmWithUser:model]; + } +} + +-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber userInfo:(QXUserHomeModel*)userInfo isPK:(BOOL)isPK{ + if (fromPitNumber == 0 || toPitNumber == 0) { + return; + } + if (toPitNumber > 10 || toPitNumber == 6 || toPitNumber == 7 || toPitNumber == 8) { + return; + } + QXRoomSeatContentView *fromSeatView = self.seatArray[fromPitNumber-1]; + QXRoomSeatContentView *toSeatView = self.seatArray[toPitNumber-1]; + QXRoomPitModel *fromPitModel = fromSeatView.pitModel; + QXRoomPitModel *totModel = toSeatView.pitModel; + + NSString* tmpPitNum = [NSString stringWithFormat:@"%@",fromPitModel.pit_number]; + fromPitModel.pit_number = totModel.pit_number; + totModel.pit_number = tmpPitNum; + NSMutableArray*arr = [NSMutableArray arrayWithArray:self.roomModel.room_info.pit_list]; + if (toPitNumber <= arr.count) { + [arr exchangeObjectAtIndex:fromPitNumber-1 withObjectAtIndex:toPitNumber-1]; + } + self.roomModel.room_info.pit_list = arr; + toSeatView.pitModel = fromPitModel; + fromSeatView.pitModel = totModel; + if (toPitNumber == 9 || toPitNumber == 1) { + + }else{ + [toSeatView hideCharm]; + } + if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) { + self.myPitNumber = toPitNumber; + } + [self configStatus]; +} +-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user{ + for (QXRoomSeatContentView *seatView in self.seatArray) { + QXRoomPitModel *md = seatView.pitModel; + if ([user.user_id isEqualToString:md.user_id]) { + md.dress = user.dress; + md.nickname = user.nickname; + md.sex = user.sex; + md.avatar = user.avatar; + md.nobility_image = user.nobility_image; + md.nickname_color = user.nickname_color; + md.mic_cycle = user.mic_cycle; + seatView.pitModel = md; + break; + } + } +} + +-(void)signDidStartWithEndTime:(NSString *)endTime signId:(NSString *)signId signDay:(NSString*)signDay signValue:(NSString*)signValue{ + self.roomModel.sign_info.sign_id = signId; + self.roomModel.sign_info.sign_status = @"1"; + self.roomModel.sign_info.end_time = endTime; + self.roomModel.sign_info.sign_day = signDay; + self.roomModel.sign_info.current_body_value = signValue; + self.dayLabel.text = [NSString stringWithFormat:@"签约%@天",self.roomModel.sign_info.sign_day]; + self.priceLabel.text = self.roomModel.sign_info.current_body_value; + [self configStatus]; + [self startTimer]; +} +/// 签约结束 +-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value{ + self.roomModel.sign_info.sign_id = @""; + self.roomModel.sign_info.sign_status = @"0"; + [self configStatus]; + [self stopTimer]; + if (_coinView) { + [_coinView hide]; + } +} +/// 签约身价变化 +-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId{ + if (![self.roomModel.sign_info.sign_id isEqualToString:signId]) { + showToast(@"场次错误"); + return; + } + self.priceLabel.text = sign_value; + if (_coinView) { + [_coinView refreshCoinList]; + } +} +/// 签约发生延时 +-(void)signTimeDelayWithEndTime:(NSString*)endTime{ + self.roomModel.sign_info.end_time = endTime; + [self startTimer]; +} + +-(void)startTimer{ + + NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970]; + // 将秒转换为毫秒 + long long milliseconds = (long long)(timeInterval); + self.startTime = self.roomModel.sign_info.end_time.longLongValue - milliseconds; + if (self.startTime <= 0) { + //时间错误不进行倒计时 + self.timeLabel.text = @"倒计时:00:00:00"; + return; + } + [self stopTimer]; + __weak typeof(self) weakSelf = self; + _timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{ + dispatch_async(dispatch_get_main_queue(), ^{ + __strong typeof(weakSelf) strongSelf = weakSelf; + if (!strongSelf) { + NSLog(@"⚠️ self has been deallocated"); + return; + } + strongSelf.startTime--; + NSInteger hour = strongSelf.startTime/60/60; + NSInteger min = (strongSelf.startTime % 3600) / 60; + NSInteger second = strongSelf.startTime % 60; + if (strongSelf.startTime <= 10) { + strongSelf.tenSecondLabel.text = [NSString stringWithFormat:@"%ld",weakSelf.startTime]; + strongSelf.tenSecondLabel.hidden = NO; + [strongSelf addBoomAnimateWithView:weakSelf.tenSecondLabel isRepeat:NO duration:0.3 removedOnCompletion:YES]; + }else{ + strongSelf.tenSecondLabel.hidden = YES; + } + strongSelf.timeLabel.text = [NSString stringWithFormat:@"倒计时:%02ld:%02ld:%02ld",hour,min,(long)second]; + if (strongSelf.startTime<=0) { + [strongSelf stopTimer]; + strongSelf.tenSecondLabel.hidden = YES; + strongSelf.timeLabel.text = @"00:00:00"; + } + }); + }]; +} +-(void)addBoomAnimateWithView:(UIView*)view isRepeat:(BOOL)isRepeat duration:(CGFloat)duration removedOnCompletion:(BOOL)removedOnCompletion{ + CABasicAnimation *anima = [CABasicAnimation animation]; + anima.keyPath = @"transform.scale"; + anima.fromValue = @1.0; + anima.toValue = @1.3; + if (isRepeat) { + anima.repeatCount = 99999; + }else{ + anima.repeatCount = 1; + } + anima.duration = duration==0?0.15:duration; + anima.autoreverses = YES; + anima.removedOnCompletion = removedOnCompletion; + [view.layer addAnimation:anima forKey:nil]; +} +-(void)stopTimer{ + if (_timer) { + [self->_timer invalidate]; + self->_timer= nil; + } + self.tenSecondLabel.hidden = YES; +} + +-(void)stopHWDMP4{ + for (QXRoomSeatContentView *seatView in self.seatArray) { + if (seatView.pitModel) { + [seatView stopHWDMP4]; + } + } +} +-(void)playHWDMP4{ + for (QXRoomSeatContentView *seatView in self.seatArray) { + if (seatView.pitModel) { + [seatView playHWDMP4]; + } + } +} + + +-(void)destroyViews{ + for (QXRoomSeatContentView *seatView in self.seatArray) { + [seatView destroyViews]; + } + if (_timer) { + [_timer invalidate]; + _timer = nil; + } +} + +-(NSMutableArray *)seatArray{ + if (!_seatArray) { + _seatArray = [NSMutableArray array]; + } + return _seatArray; +} +-(UILabel *)tenSecondLabel{ + if (!_tenSecondLabel) { + _tenSecondLabel = [[UILabel alloc] init]; + _tenSecondLabel.font = [UIFont boldSystemFontOfSize:110]; + _tenSecondLabel.textColor = [UIColor whiteColor]; + _tenSecondLabel.hidden = YES; + _tenSecondLabel.textAlignment = NSTextAlignmentCenter; + } + return _tenSecondLabel; +} +-(QXSignCoinListView *)coinView{ + if (!_coinView) { + _coinView = [[QXSignCoinListView alloc] init]; + _coinView.delegate = self; + } + return _coinView; +} +@end diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSingerView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSingerView.m index ff6e720..8e0a282 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSingerView.m +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSingerView.m @@ -207,7 +207,11 @@ -(void)configSingerSeat{ for (QXRoomSeatContentView*seatView in self.seatArray) { if ([seatView.pitModel.user_id isEqualToString:self.roomModel.singer_info.song_info.singer_user_id]) { - seatView.tagString = @"演唱者"; + if (seatView.pitModel.pit_number.intValue == 9 ) { + seatView.tagString = @""; + }else{ + seatView.tagString = @"演唱者"; + } }else{ seatView.tagString = @""; } diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatView.h b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatView.h index eedc5bf..2356181 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatView.h +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatView.h @@ -29,6 +29,8 @@ typedef NS_ENUM(NSInteger) { QXRoomSeatViewTypeFriend, /// 点唱 QXRoomSeatViewTypeSinger, + /// 签约房 + QXRoomSeatViewTypeSign }QXRoomSeatViewType; @@ -128,6 +130,15 @@ typedef NS_ENUM(NSInteger) { -(void)singerSongNextSongInfoDidChanged:(QXUserSongListModel*)model; /// 已点歌曲数量发生变化 -(void)singerSongCountDidChanged:(NSString*)count; + +/// 签约开始 +-(void)signDidStartWithEndTime:(NSString *)endTime signId:(NSString *)signId signDay:(NSString*)signDay signValue:(NSString*)signValue; +/// 签约结束 +-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value; +/// 签约身价变化 +-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId; +/// 签约身价变化 +-(void)signTimeDelayWithEndTime:(NSString*)endTime; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatView.m index 2ab8b58..e682812 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatView.m +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatView.m @@ -15,6 +15,7 @@ #import "QXRoomSeatTypeFrientView.h" #import "QXRoomUserCharmView.h" #import "QXRoomSeatTypeSingerView.h" +#import "QXRoomSeatTypeSignView.h" @interface QXRoomSeatView() /// 二卡八 @@ -34,6 +35,8 @@ /// 点唱房 @property (nonatomic,strong)QXRoomSeatTypeSingerView *singerView; +/// 签约房 +@property (nonatomic,strong)QXRoomSeatTypeSignView *signView; @property (nonatomic,strong)QXRoomUserCharmView *charmListView; @end @@ -54,62 +57,25 @@ //初始化普通视图 -(void)initNomarlView{ if (_singerView) { - _singerView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_singerView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_singerView destroyViews]; - [self->_singerView removeFromSuperview]; - self->_singerView = nil; + [self hideSinggerViewBlock:^{ [self showNormalView]; }]; return; } if (_songView) { - [[QXAgoraEngine sharedEngine] ktv_EndSing]; - _songView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_songView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_songView destroyViews]; - [self->_songView removeFromSuperview]; - self->_songView = nil; + [self hideSongViewBlock:^{ [self showNormalView]; }]; return; } if (_auctionView) { -// [_normalSeatView removeFromSuperview]; -// _normalSeatView = nil; - [[QXAgoraEngine sharedEngine] ktv_EndSing]; - _auctionView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - if (self->_auctionView.auctionInfoView != nil) { - [self->_auctionView.auctionInfoView hide]; - } - [self->_auctionView destroyViews]; - [self->_auctionView removeFromSuperview]; - self->_auctionView = nil; + [self hideAuctionViewBlock:^{ + [self showNormalView]; + }]; + return; + } + if (_signView) { + [self hideSignViewBlock:^{ [self showNormalView]; }]; return; @@ -133,19 +99,7 @@ return; } if (_roomFriendView) { - _roomFriendView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_roomFriendView destroyViews]; - [self->_roomFriendView removeFromSuperview]; - self->_roomFriendView = nil; + [self hideRoomFriendBlock:^{ [self showNormalView]; }]; return; @@ -173,100 +127,54 @@ }]; } + +-(void)hideNormalViewBlock:(void(^)(void))completion{ + _normalSeatView.transform = CGAffineTransformIdentity; + // 弹性动画 + [UIView animateWithDuration:0.5 + delay:0 + usingSpringWithDamping:0.9 + initialSpringVelocity:0.1 + options:UIViewAnimationOptionCurveEaseOut + animations:^{ + self->_normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01); + } completion:^(BOOL finished) { + [self->_normalSeatView destroyViews]; + [self->_normalSeatView removeFromSuperview]; + self->_normalSeatView = nil; + if (completion) { + completion(); + } + }]; +} //初始化拍卖视图 -(void)initAuctionView{ if (_singerView) { - _singerView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_singerView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_singerView destroyViews]; - [self->_singerView removeFromSuperview]; - self->_singerView = nil; + [self hideSinggerViewBlock:^{ [self showAuctionView]; }]; return; } if (_normalSeatView) { -// [_normalSeatView removeFromSuperview]; -// _normalSeatView = nil; - _normalSeatView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_normalSeatView destroyViews]; - [self->_normalSeatView removeFromSuperview]; - self->_normalSeatView = nil; + [self hideNormalViewBlock:^{ [self showAuctionView]; }]; return; } if (_songView) { -// [_normalSeatView removeFromSuperview]; -// _normalSeatView = nil; - [[QXAgoraEngine sharedEngine] ktv_EndSing]; - _songView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_songView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_songView destroyViews]; - [self->_songView removeFromSuperview]; - self->_songView = nil; - [self showAuctionView]; - }]; - return; - } - if (_roomPkView) { - _roomPkView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_roomPkView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_roomPkView destroyViews]; - [self->_roomPkView removeFromSuperview]; - self->_roomPkView = nil; + [self hideSongViewBlock:^{ [self showAuctionView]; }]; return; } if (_roomFriendView) { - _roomFriendView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_roomFriendView destroyViews]; - [self->_roomFriendView removeFromSuperview]; - self->_roomFriendView = nil; - [self addSubview:self.auctionView]; + [self hideRoomFriendBlock:^{ + [self showAuctionView]; + }]; + return; + } + if (_signView) { + [self hideSignViewBlock:^{ [self showAuctionView]; }]; return; @@ -294,82 +202,57 @@ }]; } +-(void)hideAuctionViewBlock:(void(^)(void))completion{ + _auctionView.transform = CGAffineTransformIdentity; + // 弹性动画 + [UIView animateWithDuration:0.5 + delay:0 + usingSpringWithDamping:0.9 + initialSpringVelocity:0.1 + options:UIViewAnimationOptionCurveEaseOut + animations:^{ + self->_auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01); + } completion:^(BOOL finished) { + if (self->_auctionView.auctionInfoView != nil) { + [self->_auctionView.auctionInfoView hide]; + } + [self->_auctionView destroyViews]; + [self->_auctionView removeFromSuperview]; + self->_auctionView = nil; + if (completion) { + completion(); + } + }]; +} //初始化ktv -(void)initSingView{ if (_singerView) { - _singerView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_singerView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_singerView destroyViews]; - [self->_singerView removeFromSuperview]; - self->_singerView = nil; + [self hideSinggerViewBlock:^{ [self showSongView]; }]; return; } if (_normalSeatView) { -// [_normalSeatView removeFromSuperview]; -// _normalSeatView = nil; - _normalSeatView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_normalSeatView destroyViews]; - [self->_normalSeatView removeFromSuperview]; - self->_normalSeatView = nil; + [self hideNormalViewBlock:^{ [self showSongView]; }]; return; } if (_auctionView) { - _auctionView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - if (self->_auctionView.auctionInfoView != nil) { - [self->_auctionView.auctionInfoView hide]; - } - [self->_auctionView destroyViews]; - [self->_auctionView removeFromSuperview]; - self->_auctionView = nil; + [self hideAuctionViewBlock:^{ [self showSongView]; }]; return; } if (_roomFriendView) { - _roomFriendView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_roomFriendView destroyViews]; - [self->_roomFriendView removeFromSuperview]; - self->_roomFriendView = nil; + [self hideRoomFriendBlock:^{ + [self showSongView]; + }]; + return; + } + if (_signView) { + [self hideSignViewBlock:^{ [self showSongView]; }]; return; @@ -397,6 +280,26 @@ }]; } +-(void)hideSongViewBlock:(void(^)(void))completion{ + [[QXAgoraEngine sharedEngine] ktv_EndSing]; + _songView.transform = CGAffineTransformIdentity; + // 弹性动画 + [UIView animateWithDuration:0.5 + delay:0 + usingSpringWithDamping:0.9 + initialSpringVelocity:0.1 + options:UIViewAnimationOptionCurveEaseOut + animations:^{ + self->_songView.transform = CGAffineTransformMakeScale(0.01, 0.01); + } completion:^(BOOL finished) { + [self->_songView destroyViews]; + [self->_songView removeFromSuperview]; + self->_songView = nil; + if (completion) { + completion(); + } + }]; +} - (void)initRoomPKView{ if (_normalSeatView) { @@ -441,78 +344,31 @@ } -(void)initRoomFriendView{ if (_singerView) { - _singerView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_singerView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_singerView destroyViews]; - [self->_singerView removeFromSuperview]; - self->_singerView = nil; + [self hideSinggerViewBlock:^{ [self showRoomFriendView]; }]; return; } if (_normalSeatView) { - - _normalSeatView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_normalSeatView destroyViews]; - [self->_normalSeatView removeFromSuperview]; - self->_normalSeatView = nil; + [self hideNormalViewBlock:^{ [self showRoomFriendView]; }]; return; } if (_auctionView) { - _auctionView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - if (self->_auctionView.auctionInfoView != nil) { - [self->_auctionView.auctionInfoView hide]; - } - [self->_auctionView destroyViews]; - [self->_auctionView removeFromSuperview]; - self->_auctionView = nil; + [self hideAuctionViewBlock:^{ [self showRoomFriendView]; }]; return; } if (_songView) { - [[QXAgoraEngine sharedEngine] ktv_EndSing]; - _songView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_songView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_songView destroyViews]; - [self->_songView removeFromSuperview]; - self->_songView = nil; + [self hideSongViewBlock:^{ + [self showRoomFriendView]; + }]; + return; + } + if (_signView) { + [self hideSignViewBlock:^{ [self showRoomFriendView]; }]; return; @@ -540,83 +396,55 @@ }]; } +-(void)hideRoomFriendBlock:(void(^)(void))completion{ + _roomFriendView.transform = CGAffineTransformIdentity; + // 弹性动画 + [UIView animateWithDuration:0.5 + delay:0 + usingSpringWithDamping:0.9 + initialSpringVelocity:0.1 + options:UIViewAnimationOptionCurveEaseOut + animations:^{ + self->_roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01); + } completion:^(BOOL finished) { + [self->_roomFriendView destroyViews]; + [self->_roomFriendView removeFromSuperview]; + self->_roomFriendView = nil; + if (completion) { + completion(); + } + }]; +} --(void)initSignerView{ + +-(void)initSingerView{ if (_roomFriendView) { - _roomFriendView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_roomFriendView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_roomFriendView destroyViews]; - [self->_roomFriendView removeFromSuperview]; - self->_roomFriendView = nil; - [self showSinggerView]; + [self hideRoomFriendBlock:^{ + [self showSingerView]; }]; return; } if (_normalSeatView) { - // [_normalSeatView removeFromSuperview]; - // _normalSeatView = nil; - _normalSeatView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_normalSeatView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_normalSeatView destroyViews]; - [self->_normalSeatView removeFromSuperview]; - self->_normalSeatView = nil; - [self showSinggerView]; + [self hideNormalViewBlock:^{ + [self showSingerView]; }]; return; } if (_auctionView) { - _auctionView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_auctionView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - if (self->_auctionView.auctionInfoView != nil) { - [self->_auctionView.auctionInfoView hide]; - } - [self->_auctionView destroyViews]; - [self->_auctionView removeFromSuperview]; - self->_auctionView = nil; - [self showSinggerView]; + [self hideAuctionViewBlock:^{ + [self showSingerView]; }]; return; } if (_songView) { - [[QXAgoraEngine sharedEngine] ktv_EndSing]; - _songView.transform = CGAffineTransformIdentity; - // 弹性动画 - [UIView animateWithDuration:0.5 - delay:0 - usingSpringWithDamping:0.9 - initialSpringVelocity:0.1 - options:UIViewAnimationOptionCurveEaseOut - animations:^{ - self->_songView.transform = CGAffineTransformMakeScale(0.01, 0.01); - } completion:^(BOOL finished) { - [self->_songView destroyViews]; - [self->_songView removeFromSuperview]; - self->_songView = nil; - [self showSinggerView]; + [self hideSongViewBlock:^{ + [self showSingerView]; + }]; + return; + } + if (_signView) { + [self hideSignViewBlock:^{ + [self showSingerView]; }]; return; } @@ -625,7 +453,7 @@ make.left.right.top.bottom.equalTo(self); }]; } --(void)showSinggerView{ +-(void)showSingerView{ [self addSubview:self.singerView]; [self.singerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.bottom.equalTo(self); @@ -643,6 +471,25 @@ }]; } +-(void)hideSinggerViewBlock:(void(^)(void))completion{ + _singerView.transform = CGAffineTransformIdentity; + // 弹性动画 + [UIView animateWithDuration:0.5 + delay:0 + usingSpringWithDamping:0.9 + initialSpringVelocity:0.1 + options:UIViewAnimationOptionCurveEaseOut + animations:^{ + self->_singerView.transform = CGAffineTransformMakeScale(0.01, 0.01); + } completion:^(BOOL finished) { + [self->_singerView destroyViews]; + [self->_singerView removeFromSuperview]; + self->_singerView = nil; + if (completion) { + completion(); + } + }]; +} - (void)initCabinView{ self.cabinView = [[QXRoomSeatTypeCabinView alloc] init]; @@ -653,7 +500,80 @@ }]; } +-(void)initSignView{ + if (_roomFriendView) { + [self hideRoomFriendBlock:^{ + [self showSignView]; + }]; + return; + } + if (_normalSeatView) { + [self hideNormalViewBlock:^{ + [self showSignView]; + }]; + return; + } + if (_auctionView) { + [self hideAuctionViewBlock:^{ + [self showSignView]; + }]; + return; + } + if (_songView) { + [self hideSongViewBlock:^{ + [self showSignView]; + }]; + return; + } + if (_singerView) { + [self hideSinggerViewBlock:^{ + [self showSignView]; + }]; + return; + } + [self addSubview:self.signView]; + [self.signView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.bottom.equalTo(self); + }]; +} +-(void)showSignView{ + [self addSubview:self.signView]; + [self.signView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.bottom.equalTo(self); + }]; + self.signView.transform = CGAffineTransformMakeScale(0.01, 0.01); + // 弹性动画 + [UIView animateWithDuration:0.5 + delay:0 + usingSpringWithDamping:0.9 + initialSpringVelocity:0.1 + options:UIViewAnimationOptionCurveEaseOut + animations:^{ + self.signView.transform = CGAffineTransformIdentity; + } completion:^(BOOL finished) { + + }]; +} +-(void)hideSignViewBlock:(void(^)(void))completion{ + _signView.transform = CGAffineTransformIdentity; + // 弹性动画 + [UIView animateWithDuration:0.5 + delay:0 + usingSpringWithDamping:0.9 + initialSpringVelocity:0.1 + options:UIViewAnimationOptionCurveEaseOut + animations:^{ + self->_signView.transform = CGAffineTransformMakeScale(0.01, 0.01); + } completion:^(BOOL finished) { + [self->_signView destroyViews]; + [self->_signView removeFromSuperview]; + self->_signView = nil; + if (completion) { + completion(); + } + }]; +} -(void)setMyPitNumber:(NSInteger)myPitNumber{ _myPitNumber = myPitNumber; @@ -676,6 +596,9 @@ case QXRoomSeatViewTypeSinger: self.singerView.myPitNumber = myPitNumber; break; + case QXRoomSeatViewTypeSign: + self.signView.myPitNumber = myPitNumber; + break; default: break; } @@ -716,7 +639,11 @@ } break; case QXRoomSeatViewTypeSinger:{ - [self initSignerView]; + [self initSingerView]; + } + break; + case QXRoomSeatViewTypeSign:{ + [self initSignView]; } break; default: @@ -782,6 +709,10 @@ case QXRoomSeatViewTypeSinger: self.singerView.roomModel = roomModel; break; + case QXRoomSeatViewTypeSign:{ + self.signView.roomModel = roomModel; + } + break; default: break; } @@ -864,6 +795,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView clearCharm]; break; + case QXRoomSeatViewTypeSign: + [self.signView clearCharm]; + break; default: break; } @@ -894,6 +828,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView roomClearUserCharmWithUserId:userId]; break; + case QXRoomSeatViewTypeSign: + [self.signView roomClearUserCharmWithUserId:userId]; + break; default: break; } @@ -923,6 +860,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber userInfo:userInfo isPK:isPK]; break; + case QXRoomSeatViewTypeSign: + [self.signView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber userInfo:userInfo isPK:isPK]; + break; default: break; } @@ -953,6 +893,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView setSeatCharmWithUser:model]; break; + case QXRoomSeatViewTypeSign: + [self.signView setSeatCharmWithUser:model]; + break; default: break; } @@ -984,6 +927,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView setSeatCharmWithUsers:users]; break; + case QXRoomSeatViewTypeSign: + [self.signView setSeatCharmWithUsers:users]; + break; default: break; } @@ -1166,18 +1112,6 @@ return _songView; } --(UIView*)getCurrentSeatView{ - if (_normalSeatView) { - return _normalSeatView; - } - if (_songView) { - return _songView; - } - if (_auctionView) { - return _auctionView; - } - return nil; -} -(void)didHugSeatWithPitNumber:(NSString *)pitNumber{ [self showOnlineListWithPitNumber:pitNumber]; @@ -1208,6 +1142,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number isPK:isPK]; break; + case QXRoomSeatViewTypeSign: + [self.signView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number isPK:isPK]; + break; default: break; } @@ -1275,6 +1212,30 @@ } } +-(void)signDidStartWithEndTime:(NSString *)endTime signId:(nonnull NSString *)signId signDay:(nonnull NSString *)signDay signValue:(nonnull NSString *)signValue{ + if (_signView) { + [self.signView signDidStartWithEndTime:endTime signId:signId signDay:signDay signValue:signValue]; + } +} +/// 签约结束 +-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value{ + if (_signView) { + [self.signView signDidEndWithUserInfo1:userInfo1 userInfo2:userInfo2 sign_value:sign_value]; + } +} +/// 签约身价变化 +-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId{ + if (_signView) { + [self.signView signValueDidChangedWithSignUserInfo:signUserInfo sign_value:sign_value signId:signId]; + } +} +/// 签约发生延时 +-(void)signTimeDelayWithEndTime:(NSString*)endTime{ + if (_signView) { + [self.signView signTimeDelayWithEndTime:endTime]; + } +} + -(void)roomUserInfoDidChanged:(QXUserHomeModel *)user{ switch (self.type) { case QXRoomSeatViewTypeNormal: @@ -1298,6 +1259,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView roomUserInfoDidChanged:user]; break; + case QXRoomSeatViewTypeSign: + [self.signView roomUserInfoDidChanged:user]; + break; default: break; } @@ -1325,6 +1289,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView stopHWDMP4]; break; + case QXRoomSeatViewTypeSign: + [self.signView stopHWDMP4]; + break; default: break; } @@ -1352,6 +1319,9 @@ case QXRoomSeatViewTypeSinger: [self.singerView playHWDMP4]; break; + case QXRoomSeatViewTypeSign: + [self.signView playHWDMP4]; + break; default: break; } @@ -1384,6 +1354,9 @@ [self.singerView destroyViews]; _singerView = nil; } + if (_signView) { + [_singerView destroyViews]; + } } -(QXRoomOnlineUserListView *)onlineListView{ @@ -1421,7 +1394,13 @@ } return _roomFriendView; } - +- (QXRoomSeatTypeSignView *)signView{ + if (!_signView) { + _signView = [[QXRoomSeatTypeSignView alloc] init]; + _signView.delegate = self; + } + return _signView; +} -(QXRoomUserCharmView *)charmListView{ if (!_charmListView) { _charmListView = [[QXRoomUserCharmView alloc] initWithFrame:[UIScreen mainScreen].bounds]; diff --git a/QXLive/Tabbar/弹窗/QXCustomAlertView.h b/QXLive/Tabbar/弹窗/QXCustomAlertView.h index eb9425b..bba5d47 100644 --- a/QXLive/Tabbar/弹窗/QXCustomAlertView.h +++ b/QXLive/Tabbar/弹窗/QXCustomAlertView.h @@ -10,6 +10,11 @@ NS_ASSUME_NONNULL_BEGIN @interface QXCustomAlertView : UIView +@property (nonatomic,strong)NSString*title; +@property (nonatomic,strong)NSString*message; +@property (nonatomic,strong)NSString*cancleTitle; +@property (nonatomic,strong)NSString*commitTitle; +@property (nonatomic,assign)BOOL isFromController; @property (nonatomic,copy)void(^commitBlock)(void); @property (nonatomic,copy)void(^cancelBlock)(void); -(void)showInView:(UIView *)view title:(NSString*)title message:(NSString*)message cancleTitle:(NSString*)cancleTitle commitTitle:(NSString*)commitTitle; diff --git a/QXLive/Tabbar/弹窗/QXCustomAlertView.m b/QXLive/Tabbar/弹窗/QXCustomAlertView.m index b7db064..b44de76 100644 --- a/QXLive/Tabbar/弹窗/QXCustomAlertView.m +++ b/QXLive/Tabbar/弹窗/QXCustomAlertView.m @@ -27,7 +27,7 @@ -(void)initSubviews{ self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5]; - self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-ScaleWidth(275))/2.0, -self.height, ScaleWidth(275), ScaleWidth(300))]; + self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-ScaleWidth(275))/2.0, 0, ScaleWidth(275), ScaleWidth(300))]; self.bgView.backgroundColor = [UIColor whiteColor]; self.bgView.layer.masksToBounds = YES; self.bgView.layer.cornerRadius = 16; @@ -91,20 +91,59 @@ +} +-(void)setTitle:(NSString *)title{ + _title = title; + self.titleLabel.text = title; +} + +-(void)setMessage:(NSString *)message{ + _message = message; + CGFloat messageHeight = [message heightForFont:[UIFont systemFontOfSize:13] width:ScaleWidth(275)-1]; + CGFloat contentHeight = 16+24+13+42+12+14+messageHeight; + if (contentHeight < 180) { + contentHeight = 180; + } + self.messageLabel.text = message; + self.bgView.height = contentHeight; + self.bgView.top = (SCREEN_HEIGHT-self.bgView.height)/2; +} + +-(void)setCancleTitle:(NSString *)cancleTitle{ + _cancleTitle = cancleTitle; + [self.cancelBtn setTitle:cancleTitle forState:(UIControlStateNormal)]; +} + +-(void)setCommitTitle:(NSString *)commitTitle{ + _commitTitle = commitTitle; + [self.commitBtn setTitle:commitTitle forState:(UIControlStateNormal)]; } -(void)cancelAction{ + if (self.isFromController) { + if (self.cancelBlock) { + self.cancelBlock(); + } + return; + } if (self.cancelBlock) { self.cancelBlock(); } [self hide]; } -(void)commitAction{ + if (self.isFromController) { + if (self.commitBlock) { + self.commitBlock(); + } + return; + } if (self.commitBlock) { self.commitBlock(); } [self hide]; } + -(void)showInView:(UIView *)view title:(NSString *)title message:(NSString *)message cancleTitle:(NSString *)cancleTitle commitTitle:(NSString *)commitTitle{ if ([title isExist]) { self.titleLabel.text = title; @@ -124,9 +163,10 @@ contentHeight = 180; } self.bgView.height = contentHeight; + self.bgView.y = -view.height; [view addSubview:self]; [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ - self.bgView.y = (SCREEN_HEIGHT-self.bgView.height)/2.0; + self.bgView.y = (view.height-self.bgView.height)/2.0; } completion:^(BOOL finished) { }]; diff --git a/QXLive/Tabbar/飘屏/QXDrifNobilityJoinRoomView.h b/QXLive/Tabbar/飘屏/QXDrifNobilityJoinRoomView.h index c804b0a..c75697a 100644 --- a/QXLive/Tabbar/飘屏/QXDrifNobilityJoinRoomView.h +++ b/QXLive/Tabbar/飘屏/QXDrifNobilityJoinRoomView.h @@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)UIImageView *nobilityImageView; @property (nonatomic,strong)UIImageView *bgImageView; @property (nonatomic,strong)UILabel *titleLabel; +@property (nonatomic,assign,readonly)BOOL isPlaying; @property (nonatomic,strong)QXRoomChatListModel *model; @property (nonatomic,strong)NSMutableArray *dataArray; - (void)setupDisplayViewInContainer:(UIView *)container; diff --git a/QXLive/Tools/Category/NSString+QX.h b/QXLive/Tools/Category/NSString+QX.h index c5f613f..5b3186e 100644 --- a/QXLive/Tools/Category/NSString+QX.h +++ b/QXLive/Tools/Category/NSString+QX.h @@ -178,6 +178,8 @@ NS_ASSUME_NONNULL_BEGIN - (NSInteger)ageWithDateOfBirth; /// 传入秒 得到 几天 几小时 + (NSString*)getTimeWithSecond:(long long)second; +/// 传入秒 得到 几天 ++(NSString *)getTimeWithDay:(long long)second; // 方法2:更严谨的实现,包含边界条件处理 + (NSInteger)convertTimestampToHoursWithPrecision:(long long)endTime; diff --git a/QXLive/Tools/Category/NSString+QX.m b/QXLive/Tools/Category/NSString+QX.m index 52e063a..d3ccd69 100644 --- a/QXLive/Tools/Category/NSString+QX.m +++ b/QXLive/Tools/Category/NSString+QX.m @@ -403,6 +403,11 @@ NSInteger hour = (NSInteger)ceil(hourT); return [NSString stringWithFormat:@"%ld天%ld小时",day,hour]; } ++(NSString *)getTimeWithDay:(long long)second{ + double day = (double)second/(60*60*24.0); + NSInteger datT = (NSInteger)ceil(day); + return [NSString stringWithFormat:@"%ld天",datT]; +} // 方法2:更严谨的实现,包含边界条件处理 + (NSInteger)convertTimestampToHoursWithPrecision:(long long)endTime { NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970]; diff --git a/QXLive/Tools/Category/UIView+QX.h b/QXLive/Tools/Category/UIView+QX.h index 2c49762..6544545 100644 --- a/QXLive/Tools/Category/UIView+QX.h +++ b/QXLive/Tools/Category/UIView+QX.h @@ -153,6 +153,17 @@ typedef NS_ENUM(NSUInteger, SRGradientDirection) { - (UINavigationController *)navigationController; +// 开始上下漂浮动画 +- (void)startSimpleFloat; + +// 开始自定义上下漂浮动画 +- (void)startSimpleFloatWithDuration:(NSTimeInterval)duration + amplitude:(CGFloat)amplitude; + +// 停止漂浮动画 +- (void)stopSimpleFloat; + + @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Tools/Category/UIView+QX.m b/QXLive/Tools/Category/UIView+QX.m index 33cbc13..cee9013 100644 --- a/QXLive/Tools/Category/UIView+QX.m +++ b/QXLive/Tools/Category/UIView+QX.m @@ -504,5 +504,32 @@ static const void* tagValue = &tagValue; } return nil; } +- (void)startSimpleFloat { + // 默认参数:3秒周期,10像素幅度 + [self startSimpleFloatWithDuration:2.0 amplitude:10.0]; +} + +- (void)startSimpleFloatWithDuration:(NSTimeInterval)duration amplitude:(CGFloat)amplitude { + // 停止之前的动画 + [self stopSimpleFloat]; + + // 保存原始位置 + CGPoint originalCenter = self.center; + + // 创建上下动画 + CABasicAnimation *floatAnimation = [CABasicAnimation animationWithKeyPath:@"position.y"]; + floatAnimation.fromValue = @(originalCenter.y - amplitude); + floatAnimation.toValue = @(originalCenter.y + amplitude); + floatAnimation.duration = duration; + floatAnimation.repeatCount = HUGE_VALF; // 无限循环 + floatAnimation.autoreverses = YES; // 自动反向,实现一上一下 + floatAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + + [self.layer addAnimation:floatAnimation forKey:@"simpleFloatAnimation"]; +} + +- (void)stopSimpleFloat { + [self.layer removeAnimationForKey:@"simpleFloatAnimation"]; +} @end diff --git a/QXLive/Tools/QXFloatAnimationHelper.h b/QXLive/Tools/QXFloatAnimationHelper.h new file mode 100644 index 0000000..f265e51 --- /dev/null +++ b/QXLive/Tools/QXFloatAnimationHelper.h @@ -0,0 +1,45 @@ +// +// QXFloatAnimationHelper.h +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import + +#import + +typedef NS_ENUM(NSInteger, FloatAnimationStyle) { + FloatAnimationStyleSmooth, // 平滑漂浮 + FloatAnimationStyleBounce, // 弹跳漂浮 + FloatAnimationStyleWave, // 波浪漂浮 + FloatAnimationStyleBreath // 呼吸式漂浮 +}; + +@interface QXFloatAnimationHelper : NSObject + +@property (nonatomic, assign) FloatAnimationStyle style; +@property (nonatomic, assign) CGFloat amplitude; // 浮动幅度 +@property (nonatomic, assign) NSTimeInterval duration; // 单次循环时长 +@property (nonatomic, assign) BOOL autoStart; // 是否自动开始 + +// 单例 ++ (instancetype)sharedController; + +// 为视图添加漂浮动画 +- (void)addFloatAnimationToView:(UIView *)view; +- (void)addFloatAnimationToView:(UIView *)view withStyle:(FloatAnimationStyle)style; + +// 为多个视图添加漂浮动画(带随机延迟) +- (void)addFloatAnimationToViews:(NSArray *)views; + +// 移除漂浮动画 +- (void)removeFloatAnimationFromView:(UIView *)view; +- (void)removeAllFloatAnimations; + +// 暂停和恢复动画 +- (void)pauseFloatAnimationForView:(UIView *)view; +- (void)resumeFloatAnimationForView:(UIView *)view; + +@end + diff --git a/QXLive/Tools/QXFloatAnimationHelper.m b/QXLive/Tools/QXFloatAnimationHelper.m new file mode 100644 index 0000000..6cb3d9c --- /dev/null +++ b/QXLive/Tools/QXFloatAnimationHelper.m @@ -0,0 +1,250 @@ +// +// QXFloatAnimationHelper.m +// QXLive +// +// Created by 启星 on 2025/11/22. +// + +#import "QXFloatAnimationHelper.h" +#import + +// 关联对象键 +static void * const kFloatAnimationKey = "kFloatAnimationKey"; + +@interface QXFloatAnimationHelper () +@property (nonatomic, strong) NSMutableSet *animatedViews; +@end + +@implementation QXFloatAnimationHelper + ++ (instancetype)sharedController { + static QXFloatAnimationHelper *instance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + instance = [[QXFloatAnimationHelper alloc] init]; + }); + return instance; +} + +- (instancetype)init { + self = [super init]; + if (self) { + _animatedViews = [NSMutableSet set]; + _style = FloatAnimationStyleSmooth; + _amplitude = 1.0; + _duration = 3.0; + _autoStart = YES; + } + return self; +} + +- (void)addFloatAnimationToView:(UIView *)view { + [self addFloatAnimationToView:view withStyle:self.style]; +} + +- (void)addFloatAnimationToView:(UIView *)view withStyle:(FloatAnimationStyle)style { + if (!view || [self.animatedViews containsObject:view]) { + return; + } + + [self.animatedViews addObject:view]; + + // 保存原始位置 + CGPoint originalCenter = view.center; + objc_setAssociatedObject(view, kFloatAnimationKey, [NSValue valueWithCGPoint:originalCenter], OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + // 根据样式创建不同的动画 + switch (style) { + case FloatAnimationStyleSmooth: + [self addSmoothFloatAnimationToView:view]; + break; + case FloatAnimationStyleBounce: + [self addBounceFloatAnimationToView:view]; + break; + case FloatAnimationStyleWave: + [self addWaveFloatAnimationToView:view]; + break; + case FloatAnimationStyleBreath: + [self addBreathFloatAnimationToView:view]; + break; + } +} + +- (void)addSmoothFloatAnimationToView:(UIView *)view { + CGPoint originalCenter = [objc_getAssociatedObject(view, kFloatAnimationKey) CGPointValue]; + + // 创建关键帧动画 + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; + + NSMutableArray *pathValues = [NSMutableArray array]; + NSInteger frames = 60; + + for (int i = 0; i <= frames; i++) { + CGFloat progress = (CGFloat)i / frames; + CGFloat radians = progress * M_PI * 2; + CGFloat offsetY = sin(radians) * self.amplitude; + + CGPoint point = CGPointMake(originalCenter.x, originalCenter.y + offsetY); + [pathValues addObject:[NSValue valueWithCGPoint:point]]; + } + + animation.values = pathValues; + animation.duration = self.duration; + animation.repeatCount = HUGE_VALF; + animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + + // 随机延迟,避免所有视图同步 + animation.beginTime = CACurrentMediaTime() + (arc4random_uniform(1000) / 1000.0) * 1.0; + + [view.layer addAnimation:animation forKey:@"smoothFloatAnimation"]; +} + +- (void)addBounceFloatAnimationToView:(UIView *)view { + CGPoint originalCenter = [objc_getAssociatedObject(view, kFloatAnimationKey) CGPointValue]; + + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position.y"]; + + // 弹跳效果的值 + NSArray *values = @[ + @(originalCenter.y), + @(originalCenter.y - self.amplitude * 0.3), + @(originalCenter.y - self.amplitude), + @(originalCenter.y - self.amplitude * 0.7), + @(originalCenter.y - self.amplitude * 0.3), + @(originalCenter.y), + @(originalCenter.y + self.amplitude * 0.2), + @(originalCenter.y + self.amplitude * 0.5), + @(originalCenter.y + self.amplitude * 0.2), + @(originalCenter.y) + ]; + + animation.values = values; + animation.duration = self.duration; + animation.repeatCount = HUGE_VALF; + + // 弹跳的时间函数 + animation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.5 :1.8 :0.8 :0.8]; + animation.beginTime = CACurrentMediaTime() + (arc4random_uniform(1000) / 1000.0) * 1.0; + + [view.layer addAnimation:animation forKey:@"bounceFloatAnimation"]; +} + +- (void)addWaveFloatAnimationToView:(UIView *)view { + CGPoint originalCenter = [objc_getAssociatedObject(view, kFloatAnimationKey) CGPointValue]; + + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position.y"]; + + NSMutableArray *values = [NSMutableArray array]; + NSInteger frames = 60; + + // 波浪效果 - 多个正弦波叠加 + for (int i = 0; i <= frames; i++) { + CGFloat progress = (CGFloat)i / frames; + + // 主波 + CGFloat wave1 = sin(progress * M_PI * 2) * self.amplitude; + // 次波 + CGFloat wave2 = sin(progress * M_PI * 4) * self.amplitude * 0.3; + + CGFloat offsetY = wave1 + wave2; + [values addObject:@(originalCenter.y + offsetY)]; + } + + animation.values = values; + animation.duration = self.duration; + animation.repeatCount = HUGE_VALF; + animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + animation.beginTime = CACurrentMediaTime() + (arc4random_uniform(1000) / 1000.0) * 1.0; + + [view.layer addAnimation:animation forKey:@"waveFloatAnimation"]; +} + +- (void)addBreathFloatAnimationToView:(UIView *)view { + CGPoint originalCenter = [objc_getAssociatedObject(view, kFloatAnimationKey) CGPointValue]; + + // 组合动画:位置 + 透明度 + CAKeyframeAnimation *positionAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position.y"]; + CAKeyframeAnimation *alphaAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; + + NSMutableArray *positionValues = [NSMutableArray array]; + NSMutableArray *alphaValues = [NSMutableArray array]; + NSInteger frames = 60; + + for (int i = 0; i <= frames; i++) { + CGFloat progress = (CGFloat)i / frames; + CGFloat radians = progress * M_PI * 2; + + // 位置变化 + CGFloat offsetY = sin(radians) * self.amplitude; + [positionValues addObject:@(originalCenter.y + offsetY)]; + + // 透明度变化 (0.8 - 1.0) + CGFloat alpha = 0.9 + 0.1 * sin(radians); + [alphaValues addObject:@(alpha)]; + } + + positionAnimation.values = positionValues; + positionAnimation.duration = self.duration; + positionAnimation.repeatCount = HUGE_VALF; + + alphaAnimation.values = alphaValues; + alphaAnimation.duration = self.duration; + alphaAnimation.repeatCount = HUGE_VALF; + + CAAnimationGroup *group = [CAAnimationGroup animation]; + group.animations = @[positionAnimation, alphaAnimation]; + group.duration = self.duration; + group.repeatCount = HUGE_VALF; + group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + group.beginTime = CACurrentMediaTime() + (arc4random_uniform(1000) / 1000.0) * 1.0; + + [view.layer addAnimation:group forKey:@"breathFloatAnimation"]; +} + +- (void)addFloatAnimationToViews:(NSArray *)views { + for (UIView *view in views) { + [self addFloatAnimationToView:view]; + } +} + +- (void)removeFloatAnimationFromView:(UIView *)view { + if (!view) return; + + [self.animatedViews removeObject:view]; + + // 移除所有漂浮动画 + [view.layer removeAnimationForKey:@"smoothFloatAnimation"]; + [view.layer removeAnimationForKey:@"bounceFloatAnimation"]; + [view.layer removeAnimationForKey:@"waveFloatAnimation"]; + [view.layer removeAnimationForKey:@"breathFloatAnimation"]; + + // 恢复原始位置 + NSValue *originalCenterValue = objc_getAssociatedObject(view, kFloatAnimationKey); + if (originalCenterValue) { + view.center = [originalCenterValue CGPointValue]; + } +} + +- (void)removeAllFloatAnimations { + for (UIView *view in self.animatedViews) { + [self removeFloatAnimationFromView:view]; + } + [self.animatedViews removeAllObjects]; +} + +- (void)pauseFloatAnimationForView:(UIView *)view { + CFTimeInterval pausedTime = [view.layer convertTime:CACurrentMediaTime() fromLayer:nil]; + view.layer.speed = 0.0; + view.layer.timeOffset = pausedTime; +} + +- (void)resumeFloatAnimationForView:(UIView *)view { + CFTimeInterval pausedTime = view.layer.timeOffset; + view.layer.speed = 1.0; + view.layer.timeOffset = 0.0; + view.layer.beginTime = 0.0; + CFTimeInterval timeSincePause = [view.layer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime; + view.layer.beginTime = timeSincePause; +} + +@end diff --git a/QXLive/活动/天空之境/QXSkyPraizeView.m b/QXLive/活动/天空之境/QXSkyPraizeView.m index 427ceee..12c9357 100644 --- a/QXLive/活动/天空之境/QXSkyPraizeView.m +++ b/QXLive/活动/天空之境/QXSkyPraizeView.m @@ -536,74 +536,98 @@ static NSInteger toSlowCount = 4; dispatch_source_set_event_handler(_fastTimer, ^{ __strong typeof(weakSelf) strongSelf = weakSelf; if (!strongSelf) return; + + // 将需要的数据提前捕获到局部变量中 + __block NSInteger roundCount = strongSelf.roundCount; + __block NSInteger currentIndex = strongSelf.currentIndex; + NSArray *finishTargetArrayIndex = [strongSelf.finishTargetArrayIndex copy]; + NSMutableArray *targetArrayIndex = [strongSelf.targetArrayIndex mutableCopy]; + __block QXSkyDrawBtnType startType = strongSelf.startType; + // 如果需要更新UI,切换到主线程 dispatch_async(dispatch_get_main_queue(), ^{ - strongSelf.roundCount++; - if ((strongSelf.roundCount / giftMaxCount == minRoundCount) && strongSelf.startType != QXSkyDrawBtnTypeOne) { + // 再次检查 strongSelf 是否存在 + __strong typeof(weakSelf) strongSelfInMain = weakSelf; + if (!strongSelfInMain) return; + + // 使用局部变量进行计算,避免频繁访问属性 + roundCount++; + NSInteger newCurrentIndex = roundCount % giftMaxCount; + + if ((roundCount / giftMaxCount == minRoundCount) && startType != QXSkyDrawBtnTypeOne) { BOOL has = NO; - for (NSNumber *index in self.finishTargetArrayIndex) { - if (index.integerValue == self.currentIndex) { + for (NSNumber *index in finishTargetArrayIndex) { + if (index.integerValue == currentIndex) { has = YES; break; } } - self.currentGiftView.isSelected = NO; + + strongSelfInMain.currentGiftView.isSelected = NO; + + QXSkyPraizeSubView *giftView = strongSelfInMain.allViewsArray[newCurrentIndex]; if (has) { - QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; giftView.isSelected = YES; - }else{ - QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; + } else { giftView.isSelected = NO; } - }else{ + } else { /// 把上一个选中状态置为未选中 - strongSelf.currentGiftView.isSelected = NO; + strongSelfInMain.currentGiftView.isSelected = NO; } + /// 计算当前下标 - strongSelf.currentIndex = strongSelf.roundCount%giftMaxCount; + strongSelfInMain.currentIndex = newCurrentIndex; + strongSelfInMain.roundCount = roundCount; + /// 获取当前选中的view 并设置为选中状态 - QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; - giftView.isSelected = YES; + QXSkyPraizeSubView *currentGiftView = strongSelfInMain.allViewsArray[newCurrentIndex]; + currentGiftView.isSelected = YES; /// 重新赋值给选中view - strongSelf.currentGiftView = giftView; + strongSelfInMain.currentGiftView = currentGiftView; - if (strongSelf.roundCount / giftMaxCount == minRoundCount) { - for (NSNumber *index in strongSelf.targetArrayIndex) { - if (strongSelf.currentIndex == index.integerValue) { - QXSkyPraizeSubView *giftView = strongSelf.allViewsArray[index.integerValue]; - giftView.isSelected = YES; - giftView.resultView.hidden = NO; - [giftView startPulseAnimationWithLayer]; - [strongSelf.targetArrayIndex removeObject:index]; - [strongSelf.finishTargetArrayIndex addObject:index]; + if (roundCount / giftMaxCount == minRoundCount) { + for (NSNumber *index in targetArrayIndex) { + if (newCurrentIndex == index.integerValue) { + QXSkyPraizeSubView *targetGiftView = strongSelfInMain.allViewsArray[index.integerValue]; + targetGiftView.isSelected = YES; + targetGiftView.resultView.hidden = NO; + [targetGiftView startPulseAnimationWithLayer]; + + // 在主线程安全地修改数组 + [strongSelfInMain.targetArrayIndex removeObject:index]; + [strongSelfInMain.finishTargetArrayIndex addObject:index]; break; } } - dispatch_source_set_timer(strongSelf.fastTimer, - dispatch_time(DISPATCH_TIME_NOW, 0.03 * NSEC_PER_SEC), - DISPATCH_TIME_FOREVER, - 0.01 * NSEC_PER_SEC); - if (strongSelf.targetArrayIndex.count == 0) { - strongSelf.isDrawing = NO; - [strongSelf stopFastAnimate]; - [strongSelf animateFinishedSendGift]; + + dispatch_source_set_timer(strongSelfInMain.fastTimer, + dispatch_time(DISPATCH_TIME_NOW, 0.03 * NSEC_PER_SEC), + DISPATCH_TIME_FOREVER, + 0.01 * NSEC_PER_SEC); + + if (strongSelfInMain.targetArrayIndex.count == 0) { + strongSelfInMain.isDrawing = NO; + [strongSelfInMain stopFastAnimate]; + [strongSelfInMain animateFinishedSendGift]; } - // } - }else{ - strongSelf.delayTime = strongSelf.delayTime-0.02; - if (strongSelf.delayTime <= 0.03) { - strongSelf.delayTime = 0.03; + } else { + // 使用局部变量避免频繁访问属性 + NSTimeInterval delayTime = strongSelfInMain.delayTime - 0.02; + if (delayTime <= 0.03) { + delayTime = 0.03; } - dispatch_source_set_timer(strongSelf.fastTimer, - dispatch_time(DISPATCH_TIME_NOW, strongSelf.delayTime * NSEC_PER_SEC), - DISPATCH_TIME_FOREVER, - 0.01 * NSEC_PER_SEC); + strongSelfInMain.delayTime = delayTime; + + dispatch_source_set_timer(strongSelfInMain.fastTimer, + dispatch_time(DISPATCH_TIME_NOW, delayTime * NSEC_PER_SEC), + DISPATCH_TIME_FOREVER, + 0.01 * NSEC_PER_SEC); } - - }); }); + dispatch_resume(_fastTimer); } -(void)animateFinishedSendGift{ @@ -724,6 +748,13 @@ static NSInteger toSlowCount = 4; -(void)destroyViews{ [[NSNotificationCenter defaultCenter] removeObserver:self]; } +- (void)dealloc { + if (_fastTimer) { + dispatch_source_cancel(_fastTimer); + _fastTimer = nil; + } + NSLog(@"%@ dealloc", NSStringFromClass([self class])); +} @end diff --git a/QXLive/活动/岁月之城/QXAgePraizeView.m b/QXLive/活动/岁月之城/QXAgePraizeView.m index 132997a..57d7cb2 100644 --- a/QXLive/活动/岁月之城/QXAgePraizeView.m +++ b/QXLive/活动/岁月之城/QXAgePraizeView.m @@ -568,74 +568,98 @@ static NSInteger toSlowCount = 4; dispatch_source_set_event_handler(_fastTimer, ^{ __strong typeof(weakSelf) strongSelf = weakSelf; if (!strongSelf) return; + + // 将需要的数据提前捕获到局部变量中 + __block NSInteger roundCount = strongSelf.roundCount; + __block NSInteger currentIndex = strongSelf.currentIndex; + NSArray *finishTargetArrayIndex = [strongSelf.finishTargetArrayIndex copy]; + NSMutableArray *targetArrayIndex = [strongSelf.targetArrayIndex mutableCopy]; + __block QXAgeDrawBtnType startType = strongSelf.startType; + // 如果需要更新UI,切换到主线程 dispatch_async(dispatch_get_main_queue(), ^{ - strongSelf.roundCount++; - if ((strongSelf.roundCount / giftMaxCount == minRoundCount) && strongSelf.startType != QXAgeDrawBtnTypeOne) { + // 再次检查 strongSelf 是否存在 + __strong typeof(weakSelf) strongSelfInMain = weakSelf; + if (!strongSelfInMain) return; + + // 使用局部变量进行计算,避免频繁访问属性 + roundCount++; + NSInteger newCurrentIndex = roundCount % giftMaxCount; + + if ((roundCount / giftMaxCount == minRoundCount) && startType != QXSkyDrawBtnTypeOne) { BOOL has = NO; - for (NSNumber *index in strongSelf.finishTargetArrayIndex) { - if (index.integerValue == strongSelf.currentIndex) { + for (NSNumber *index in finishTargetArrayIndex) { + if (index.integerValue == currentIndex) { has = YES; break; } } - self.currentGiftView.isSelected = NO; + + strongSelfInMain.currentGiftView.isSelected = NO; + + QXAgePraizeSubView *giftView = strongSelfInMain.allViewsArray[newCurrentIndex]; if (has) { - QXAgePraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; giftView.isSelected = YES; - }else{ - QXAgePraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; + } else { giftView.isSelected = NO; } - }else{ + } else { /// 把上一个选中状态置为未选中 - strongSelf.currentGiftView.isSelected = NO; + strongSelfInMain.currentGiftView.isSelected = NO; } + /// 计算当前下标 - strongSelf.currentIndex = strongSelf.roundCount%giftMaxCount; + strongSelfInMain.currentIndex = newCurrentIndex; + strongSelfInMain.roundCount = roundCount; + /// 获取当前选中的view 并设置为选中状态 - QXAgePraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; - giftView.isSelected = YES; + QXAgePraizeSubView *currentGiftView = strongSelfInMain.allViewsArray[newCurrentIndex]; + currentGiftView.isSelected = YES; /// 重新赋值给选中view - strongSelf.currentGiftView = giftView; + strongSelfInMain.currentGiftView = currentGiftView; - if (strongSelf.roundCount / giftMaxCount == minRoundCount) { - for (NSNumber *index in strongSelf.targetArrayIndex) { - if (strongSelf.currentIndex == index.integerValue) { - QXAgePraizeSubView *giftView = strongSelf.allViewsArray[index.integerValue]; - giftView.isSelected = YES; - giftView.resultView.hidden = NO; - [giftView startPulseAnimationWithLayer]; - [strongSelf.targetArrayIndex removeObject:index]; - [strongSelf.finishTargetArrayIndex addObject:index]; + if (roundCount / giftMaxCount == minRoundCount) { + for (NSNumber *index in targetArrayIndex) { + if (newCurrentIndex == index.integerValue) { + QXAgePraizeSubView *targetGiftView = strongSelfInMain.allViewsArray[index.integerValue]; + targetGiftView.isSelected = YES; + targetGiftView.resultView.hidden = NO; + [targetGiftView startPulseAnimationWithLayer]; + + // 在主线程安全地修改数组 + [strongSelfInMain.targetArrayIndex removeObject:index]; + [strongSelfInMain.finishTargetArrayIndex addObject:index]; break; } } - dispatch_source_set_timer(strongSelf.fastTimer, - dispatch_time(DISPATCH_TIME_NOW, 0.03 * NSEC_PER_SEC), - DISPATCH_TIME_FOREVER, - 0.01 * NSEC_PER_SEC); - if (strongSelf.targetArrayIndex.count == 0) { - strongSelf.isDrawing = NO; - [strongSelf stopFastAnimate]; - [strongSelf animateFinishedSendGift]; + + dispatch_source_set_timer(strongSelfInMain.fastTimer, + dispatch_time(DISPATCH_TIME_NOW, 0.03 * NSEC_PER_SEC), + DISPATCH_TIME_FOREVER, + 0.01 * NSEC_PER_SEC); + + if (strongSelfInMain.targetArrayIndex.count == 0) { + strongSelfInMain.isDrawing = NO; + [strongSelfInMain stopFastAnimate]; + [strongSelfInMain animateFinishedSendGift]; } - // } - }else{ - strongSelf.delayTime = strongSelf.delayTime-0.02; - if (strongSelf.delayTime <= 0.03) { - strongSelf.delayTime = 0.03; + } else { + // 使用局部变量避免频繁访问属性 + NSTimeInterval delayTime = strongSelfInMain.delayTime - 0.02; + if (delayTime <= 0.03) { + delayTime = 0.03; } - dispatch_source_set_timer(strongSelf.fastTimer, - dispatch_time(DISPATCH_TIME_NOW, strongSelf.delayTime * NSEC_PER_SEC), - DISPATCH_TIME_FOREVER, - 0.01 * NSEC_PER_SEC); + strongSelfInMain.delayTime = delayTime; + + dispatch_source_set_timer(strongSelfInMain.fastTimer, + dispatch_time(DISPATCH_TIME_NOW, delayTime * NSEC_PER_SEC), + DISPATCH_TIME_FOREVER, + 0.01 * NSEC_PER_SEC); } - - }); }); + dispatch_resume(_fastTimer); } -(void)animateFinishedSendGift{ diff --git a/QXLive/活动/时空之巅/QXTimePraizeView.m b/QXLive/活动/时空之巅/QXTimePraizeView.m index ac446f2..5da93f0 100644 --- a/QXLive/活动/时空之巅/QXTimePraizeView.m +++ b/QXLive/活动/时空之巅/QXTimePraizeView.m @@ -569,74 +569,98 @@ static NSInteger toSlowCount = 4; dispatch_source_set_event_handler(_fastTimer, ^{ __strong typeof(weakSelf) strongSelf = weakSelf; if (!strongSelf) return; + + // 将需要的数据提前捕获到局部变量中 + __block NSInteger roundCount = strongSelf.roundCount; + __block NSInteger currentIndex = strongSelf.currentIndex; + NSArray *finishTargetArrayIndex = [strongSelf.finishTargetArrayIndex copy]; + NSMutableArray *targetArrayIndex = [strongSelf.targetArrayIndex mutableCopy]; + __block QXTimeDrawBtnType startType = strongSelf.startType; + // 如果需要更新UI,切换到主线程 dispatch_async(dispatch_get_main_queue(), ^{ - strongSelf.roundCount++; - if ((strongSelf.roundCount / giftMaxCount == minRoundCount) && strongSelf.startType != QXTimeDrawBtnTypeOne) { + // 再次检查 strongSelf 是否存在 + __strong typeof(weakSelf) strongSelfInMain = weakSelf; + if (!strongSelfInMain) return; + + // 使用局部变量进行计算,避免频繁访问属性 + roundCount++; + NSInteger newCurrentIndex = roundCount % giftMaxCount; + + if ((roundCount / giftMaxCount == minRoundCount) && startType != QXSkyDrawBtnTypeOne) { BOOL has = NO; - for (NSNumber *index in strongSelf.finishTargetArrayIndex) { - if (index.integerValue == strongSelf.currentIndex) { + for (NSNumber *index in finishTargetArrayIndex) { + if (index.integerValue == currentIndex) { has = YES; break; } } - self.currentGiftView.isSelected = NO; + + strongSelfInMain.currentGiftView.isSelected = NO; + + QXTimePraizeSubView *giftView = strongSelfInMain.allViewsArray[newCurrentIndex]; if (has) { - QXTimePraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; giftView.isSelected = YES; - }else{ - QXTimePraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; + } else { giftView.isSelected = NO; } - }else{ + } else { /// 把上一个选中状态置为未选中 - strongSelf.currentGiftView.isSelected = NO; + strongSelfInMain.currentGiftView.isSelected = NO; } + /// 计算当前下标 - strongSelf.currentIndex = strongSelf.roundCount%giftMaxCount; + strongSelfInMain.currentIndex = newCurrentIndex; + strongSelfInMain.roundCount = roundCount; + /// 获取当前选中的view 并设置为选中状态 - QXTimePraizeSubView *giftView = strongSelf.allViewsArray[strongSelf.currentIndex]; - giftView.isSelected = YES; + QXTimePraizeSubView *currentGiftView = strongSelfInMain.allViewsArray[newCurrentIndex]; + currentGiftView.isSelected = YES; /// 重新赋值给选中view - strongSelf.currentGiftView = giftView; + strongSelfInMain.currentGiftView = currentGiftView; - if (strongSelf.roundCount / giftMaxCount == minRoundCount) { - for (NSNumber *index in strongSelf.targetArrayIndex) { - if (strongSelf.currentIndex == index.integerValue) { - QXTimePraizeSubView *giftView = strongSelf.allViewsArray[index.integerValue]; - giftView.isSelected = YES; - giftView.resultView.hidden = NO; - [giftView startPulseAnimationWithLayer]; - [strongSelf.targetArrayIndex removeObject:index]; - [strongSelf.finishTargetArrayIndex addObject:index]; + if (roundCount / giftMaxCount == minRoundCount) { + for (NSNumber *index in targetArrayIndex) { + if (newCurrentIndex == index.integerValue) { + QXTimePraizeSubView *targetGiftView = strongSelfInMain.allViewsArray[index.integerValue]; + targetGiftView.isSelected = YES; + targetGiftView.resultView.hidden = NO; + [targetGiftView startPulseAnimationWithLayer]; + + // 在主线程安全地修改数组 + [strongSelfInMain.targetArrayIndex removeObject:index]; + [strongSelfInMain.finishTargetArrayIndex addObject:index]; break; } } - dispatch_source_set_timer(strongSelf.fastTimer, - dispatch_time(DISPATCH_TIME_NOW, 0.03 * NSEC_PER_SEC), - DISPATCH_TIME_FOREVER, - 0.01 * NSEC_PER_SEC); - if (strongSelf.targetArrayIndex.count == 0) { - strongSelf.isDrawing = NO; - [strongSelf stopFastAnimate]; - [strongSelf animateFinishedSendGift]; + + dispatch_source_set_timer(strongSelfInMain.fastTimer, + dispatch_time(DISPATCH_TIME_NOW, 0.03 * NSEC_PER_SEC), + DISPATCH_TIME_FOREVER, + 0.01 * NSEC_PER_SEC); + + if (strongSelfInMain.targetArrayIndex.count == 0) { + strongSelfInMain.isDrawing = NO; + [strongSelfInMain stopFastAnimate]; + [strongSelfInMain animateFinishedSendGift]; } - // } - }else{ - strongSelf.delayTime = strongSelf.delayTime-0.02; - if (strongSelf.delayTime <= 0.03) { - strongSelf.delayTime = 0.03; + } else { + // 使用局部变量避免频繁访问属性 + NSTimeInterval delayTime = strongSelfInMain.delayTime - 0.02; + if (delayTime <= 0.03) { + delayTime = 0.03; } - dispatch_source_set_timer(strongSelf.fastTimer, - dispatch_time(DISPATCH_TIME_NOW, strongSelf.delayTime * NSEC_PER_SEC), - DISPATCH_TIME_FOREVER, - 0.01 * NSEC_PER_SEC); + strongSelfInMain.delayTime = delayTime; + + dispatch_source_set_timer(strongSelfInMain.fastTimer, + dispatch_time(DISPATCH_TIME_NOW, delayTime * NSEC_PER_SEC), + DISPATCH_TIME_FOREVER, + 0.01 * NSEC_PER_SEC); } - - }); }); + dispatch_resume(_fastTimer); } -(void)animateFinishedSendGift{