diff --git a/Podfile b/Podfile index bd91b7b..71b5e8e 100644 --- a/Podfile +++ b/Podfile @@ -79,6 +79,8 @@ def taget_pods pod 'TUIConversation', :path => "./TUIKit/TUIConversation" # pod 'RTCRoomEngine' pod 'TIMPush' + #占位 + pod 'DZNEmptyDataSet' end target 'QXLive' do diff --git a/QXLive.xcodeproj/project.pbxproj b/QXLive.xcodeproj/project.pbxproj index 2b15caf..051c692 100644 --- a/QXLive.xcodeproj/project.pbxproj +++ b/QXLive.xcodeproj/project.pbxproj @@ -748,7 +748,7 @@ CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 8798G5VMH9; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -787,7 +787,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.1.8; + MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -814,7 +814,7 @@ CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 8798G5VMH9; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -853,7 +853,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.1.8; + MARKETING_VERSION = 1.2.0; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/QXLive/Base/QXGlobal.m b/QXLive/Base/QXGlobal.m index 0772a54..c3e35ce 100644 --- a/QXLive/Base/QXGlobal.m +++ b/QXLive/Base/QXGlobal.m @@ -336,7 +336,17 @@ -(void)checkAndUpdateRedPackets{ if ([self.roomId isExist]) { - [QXMineNetwork appKeepAliveWithRoomId:self.roomId]; + [QXMineNetwork appKeepAliveWithRoomId:self.roomId successBlock:^(NSDictionary * _Nonnull dict) { + NSString *string = [NSString stringWithFormat:@"%@",dict[@"not_received_tasks_num"]]; + if ([string containsString:@"null"]) { + string = @""; + } + if (self.roomVC) { + self.roomVC.taskWaitDrawNum = string; + } + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; } } diff --git a/QXLive/Mine(音域)/Controller/QXMineViewController.m b/QXLive/Mine(音域)/Controller/QXMineViewController.m index 7fa9436..16ffb5e 100644 --- a/QXLive/Mine(音域)/Controller/QXMineViewController.m +++ b/QXLive/Mine(音域)/Controller/QXMineViewController.m @@ -49,6 +49,7 @@ @property (nonatomic,strong)QXUserModel *userModel; @property (nonatomic,strong)NSMutableArray *bannerArry; @property (nonatomic,strong)NSString *cancelCode; +@property (nonatomic,strong)NSString *taskNum; @end @implementation QXMineViewController @@ -106,6 +107,16 @@ weakSelf.tableHeaderView.earnings = earnings; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + }]; + [self getTaskCount]; +} + +-(void)getTaskCount{ + MJWeakSelf + [QXMineNetwork appTaskWaitDrawSuccessBlock:^(NSString * _Nonnull num) { + weakSelf.taskNum = num; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + }]; } #pragma mark - QXMineServiceCellDelegate @@ -323,6 +334,7 @@ } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ QXMineServiceCell *cell = [QXMineServiceCell cellWithTableView:tableView]; + cell.taskNumber = self.taskNum; cell.delegate = self; cell.singerIsAuth = self.userModel.singer_status.intValue==1; if (indexPath.row == 0) { diff --git a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.h b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.h index a9e64c6..384e3e9 100644 --- a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.h +++ b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.h @@ -13,4 +13,9 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface QXTaskTypeCell : UICollectionViewCell +@property (nonatomic,strong)QXDayTaskTypeModel *model; +@property (nonatomic,strong)UIButton *titleBtn; +@property (nonatomic,strong)UIButton *lockImageBtn; +@end NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m index b8c6e20..3c1dfb7 100644 --- a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m +++ b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m @@ -18,11 +18,16 @@ #import "QXRechargeViewcController.h" #import "QXSignInAppView.h" #import "QXCreatPhotosViewController.h" +#import "QXCreateRoomViewController.h" -@interface QXTaskViewController () +@interface QXTaskViewController () @property (nonatomic,strong)QXDayTaskTopView *topView; +@property (nonatomic,strong)UIView *bottomView; @property (nonatomic,strong)UITableView *tableView; +@property (nonatomic,strong)UICollectionView *collectionView; @property (nonatomic,strong)QXDayTaskModel *model; +@property (nonatomic,strong)QXDayTaskTypeModel *typeModel; +@property (nonatomic,strong)UIImageView *nodataView; @end @implementation QXTaskViewController @@ -50,25 +55,54 @@ - (void)initSubViews{ self.bgImageHidden = YES; self.view.backgroundColor = RGB16(0xE3FAE4); - self.tableView.tableHeaderView = self.topView; - [self.view addSubview:self.tableView]; + [self.view addSubview:self.topView]; + self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(16, self.topView.bottom, SCREEN_WIDTH-32, SCREEN_HEIGHT-self.topView.bottom-kSafeAreaBottom)]; + self.bottomView.backgroundColor = RGB16(0xffffff); + [self.bottomView addRoundedCornersWithRadius:16]; + self.tableView.frame = CGRectMake(0, 48, self.bottomView.width, self.bottomView.height-48); + [self.bottomView addSubview:self.tableView]; + [self.view addSubview:self.bottomView]; + self.nodataView = [[UIImageView alloc] initWithFrame:self.tableView.frame]; + self.nodataView.hidden = YES; + [self.bottomView addSubview:self.nodataView]; + [self createTaskTypeView]; +} +-(void)createTaskTypeView{ + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 20; + layout.sectionInset = UIEdgeInsetsMake(0, 14, 0, 16); + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + [self.collectionView registerClass:[QXTaskTypeCell class] forCellWithReuseIdentifier:@"QXTaskTypeCell"]; + self.collectionView.delegate = self; + self.collectionView.dataSource = self; + self.collectionView.showsHorizontalScrollIndicator = NO; + self.collectionView.bounces = NO; + self.collectionView.pagingEnabled = NO; + self.collectionView.backgroundColor = [UIColor clearColor]; + [self.bottomView addSubview:self.collectionView]; + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(0); + make.top.mas_equalTo(0); + make.right.mas_equalTo(0); + make.height.mas_equalTo(48); + }]; + + } - -(void)getDayTask{ MJWeakSelf [QXMineNetwork getDayTaskListSuccessBlock:^(QXDayTaskModel * _Nonnull model) { weakSelf.model = model; - [weakSelf.dataArray removeAllObjects]; - [weakSelf.dataArray addObjectsFromArray:model.tasks]; - for (int i = 0 ; i < model.tasks.count; i++) { - QXDayTaskTypeModel*md = model.tasks[i]; - if (md.task_list.count == 0) { - [weakSelf.dataArray removeObjectAtIndex:i]; - } - } - weakSelf.model.tasks = weakSelf.dataArray; weakSelf.topView.model = model; - [weakSelf.tableView reloadData]; + weakSelf.typeModel = model.tasks.firstObject; + if (weakSelf.typeModel) { + weakSelf.typeModel.isSelected = YES; + [weakSelf.dataArray removeAllObjects]; + [weakSelf.dataArray addObjectsFromArray:weakSelf.typeModel.task_list]; + [weakSelf.tableView reloadData]; + } + [weakSelf.collectionView reloadData]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { }]; @@ -80,7 +114,7 @@ } -(QXDayTaskTopView *)topView{ if (!_topView) { - _topView = [[QXDayTaskTopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-32, ScaleWidth(285)+12)]; + _topView = [[QXDayTaskTopView alloc] initWithFrame:CGRectMake(16, NavContentHeight, SCREEN_WIDTH-32, ScaleWidth(285))]; } return _topView; } @@ -143,7 +177,9 @@ [self.navigationController pushViewController:vc animated:YES]; return; }else if (taskModel.jump_type.intValue == 7) { - + QXCreateRoomViewController *vc = [[QXCreateRoomViewController alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; + return; } }else if (taskModel.task_status.intValue == 2) { @@ -156,53 +192,64 @@ }]; } } - -#pragma mark - UITableViewDataSource,UITableViewDelegate --(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ - if (self.model == nil) { - return 0; - } +#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource +-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ return self.model.tasks.count; } +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + QXTaskTypeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXTaskTypeCell" forIndexPath:indexPath]; + cell.model = self.model.tasks[indexPath.row]; + return cell; +} +-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ + QXDayTaskTypeModel *model = self.model.tasks[indexPath.row]; + CGFloat itemWidth = [model.task_type_name widthForFont:[UIFont boldSystemFontOfSize:16]]; + if (model.is_lock.intValue == 1) { + itemWidth += 21; + } + itemWidth += 5; + return CGSizeMake(itemWidth, 48); +} +-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ + QXDayTaskTypeModel *model = self.model.tasks[indexPath.row]; + if (model == self.typeModel) { + return; + } + if (self.typeModel) { + self.typeModel.isSelected = NO; + } + model.isSelected = YES; + self.typeModel = model; + [collectionView reloadData]; + [self.dataArray removeAllObjects]; + [self.dataArray addObjectsFromArray:model.task_list]; + [self.tableView reloadData]; + if (model.is_lock.intValue == 1) { + if ([model.task_type_name containsString:@"情侣"]) { + self.nodataView.hidden = NO; + self.nodataView.image = [UIImage imageNamed:@"task_cp_no_data"]; + }else if ([model.task_type_name containsString:@"师徒"]) { + self.nodataView.hidden = NO; + self.nodataView.image = [UIImage imageNamed:@"task_master_no_data"]; + }else{ + self.nodataView.hidden = YES; + } + }else{ + self.nodataView.hidden = YES; + } +} + +#pragma mark - UITableViewDataSource,UITableViewDelegate -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ - QXDayTaskTypeModel *model = self.model.tasks[section]; - return model.task_list.count; + return self.dataArray.count; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ QXDayTaskCell *cell = [QXDayTaskCell cellWithTableView:tableView]; - QXDayTaskTypeModel *model = self.model.tasks[indexPath.section]; - QXDayTaskListModel *taskModel = model.task_list[indexPath.row]; + QXDayTaskListModel *taskModel = self.dataArray[indexPath.row]; cell.model = taskModel; cell.delegate = self; return cell; } --(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ - UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-32, 35)]; - header.backgroundColor = [UIColor whiteColor]; - [header addRoundedCornersWithRadius:17.5 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)]; - UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 12, SCREEN_WIDTH-32*2, 23)]; - titleLabel.font = [UIFont boldSystemFontOfSize:16]; - titleLabel.textColor = QXConfig.textColor; - QXDayTaskTypeModel *model = self.model.tasks[section]; - titleLabel.text = model.task_type_name; - [header addSubview:titleLabel]; - return header; -} --(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ - return 35; -} --(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ - UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-32, 35)]; - footer.backgroundColor = [UIColor clearColor]; - UIView *roundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-32, 25)]; - roundView.backgroundColor = [UIColor whiteColor]; - [roundView addRoundedCornersWithRadius:17.5 byRoundingCorners:(UIRectCornerBottomLeft|UIRectCornerBottomRight)]; - [footer addSubview:roundView]; - return footer; -} --(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ - return 35; -} -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ QXDayTaskTypeModel *model = self.model.tasks[indexPath.section]; QXDayTaskListModel *taskModel = model.task_list[indexPath.row]; @@ -215,7 +262,7 @@ -(UITableView *)tableView{ if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectMake(16, NavContentHeight, SCREEN_WIDTH-32, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStyleGrouped)]; + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(16, self.topView.bottom+12, SCREEN_WIDTH-32, SCREEN_HEIGHT-self.topView.bottom-12) style:(UITableViewStylePlain)]; _tableView.dataSource = self; _tableView.delegate = self; _tableView.backgroundColor = [UIColor clearColor]; @@ -231,3 +278,64 @@ return _tableView; } @end + +@implementation QXTaskTypeCell + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + [self initSubviews]; + } + return self; +} +-(void)setModel:(QXDayTaskTypeModel *)model{ + _model = model; + [self.titleBtn setTitle:model.task_type_name forState:(UIControlStateNormal)]; + if (model.is_lock.intValue == 1) { + [self.titleBtn mas_remakeConstraints:^(MASConstraintMaker *make) { + make.left.top.bottom.equalTo(self); + make.right.equalTo(self.lockImageBtn.mas_left); + }]; + self.lockImageBtn.hidden = NO; + }else{ + self.lockImageBtn.hidden = YES; + [self.titleBtn mas_remakeConstraints:^(MASConstraintMaker *make) { + make.left.top.bottom.equalTo(self); + make.right.equalTo(self.lockImageBtn.mas_right); + }]; + } + if (model.isSelected) { + self.titleBtn.selected = YES; + self.lockImageBtn.selected = YES; + }else{ + self.titleBtn.selected = NO; + self.lockImageBtn.selected = NO; + } +} +-(void)initSubviews{ + + self.lockImageBtn = [[UIButton alloc] init]; + [self.lockImageBtn setImage:[UIImage imageNamed:@"task_lock_icon_nor"] forState:(UIControlStateNormal)]; + [self.lockImageBtn setImage:[UIImage imageNamed:@"task_lock_icon_sel"] forState:(UIControlStateSelected)]; + [self addSubview:self.lockImageBtn]; + [self.lockImageBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self); + make.height.width.mas_equalTo(21); + make.centerY.equalTo(self); + }]; + self.lockImageBtn.userInteractionEnabled = NO; + + self.titleBtn = [[UIButton alloc] init]; + [self.titleBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateSelected)]; + [self.titleBtn setTitleColor:RGB16A(0x000000,0.45) forState:(UIControlStateNormal)]; + self.titleBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16]; + [self addSubview:self.titleBtn]; + [self.titleBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.bottom.equalTo(self); + make.right.equalTo(self.lockImageBtn.mas_left); + }]; + self.titleBtn.userInteractionEnabled = NO; +} + +@end diff --git a/QXLive/Mine(音域)/Controller/设置/QXRealNameViewController.m b/QXLive/Mine(音域)/Controller/设置/QXRealNameViewController.m index a71d408..7ac8a74 100644 --- a/QXLive/Mine(音域)/Controller/设置/QXRealNameViewController.m +++ b/QXLive/Mine(音域)/Controller/设置/QXRealNameViewController.m @@ -323,10 +323,10 @@ [QXMineNetwork postRealNameResultWithOrderNo:faceVerifyResult.orderNo successBlock:^(NSDictionary * _Nonnull dict) { } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - + showToast(msg); }]; }else{ - showToast(@"实名认证失败"); + showToast(@"人脸认证失败"); } } diff --git a/QXLive/Mine(音域)/Model/QXDayTaskModel.h b/QXLive/Mine(音域)/Model/QXDayTaskModel.h index 4d7f87a..2cd2f61 100644 --- a/QXLive/Mine(音域)/Model/QXDayTaskModel.h +++ b/QXLive/Mine(音域)/Model/QXDayTaskModel.h @@ -51,7 +51,11 @@ NS_ASSUME_NONNULL_BEGIN //@property(nonatomic,strong)NSArray *teacher_tasks; @property(nonatomic,strong)NSString *task_type_name; @property(nonatomic,strong)NSString *task_type_id; +///1 锁 0 开 +@property(nonatomic,strong)NSString *is_lock; @property(nonatomic,strong)NSArray*task_list; + +@property(nonatomic,assign)BOOL isSelected; @end @interface QXDayTaskListModel : NSObject diff --git a/QXLive/Mine(音域)/Model/QXServiceModel.h b/QXLive/Mine(音域)/Model/QXServiceModel.h index 339d239..27cd1f0 100644 --- a/QXLive/Mine(音域)/Model/QXServiceModel.h +++ b/QXLive/Mine(音域)/Model/QXServiceModel.h @@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,assign)NSInteger type; @property (nonatomic,strong)NSString* icon; + +@property (nonatomic,strong)NSString* unreadNumber; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Services/QXMineNetwork.h b/QXLive/Mine(音域)/Services/QXMineNetwork.h index 4c0d743..9116b69 100644 --- a/QXLive/Mine(音域)/Services/QXMineNetwork.h +++ b/QXLive/Mine(音域)/Services/QXMineNetwork.h @@ -516,6 +516,7 @@ NS_ASSUME_NONNULL_BEGIN */ +(void)nextSongWithRoomId:(NSString*)room_id now_did:(NSString*)now_did + is_auto_next:(NSString*)is_auto_next successBlock:(void (^)(NSDictionary* dict))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock; @@ -1395,7 +1396,9 @@ NS_ASSUME_NONNULL_BEGIN /** 在线 */ -+(void)appKeepAliveWithRoomId:(NSString*)room_id; ++(void)appKeepAliveWithRoomId:(NSString*)room_id + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; /** 签约房间主持邀请上签约麦用户拒绝 @@ -1429,6 +1432,13 @@ NS_ASSUME_NONNULL_BEGIN +(void)appSignTaskStatusSuccessBlock:(void (^)(NSString* status))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock; +/** + 每日任务未领取数量 + */ ++(void)appTaskWaitDrawSuccessBlock:(void (^)(NSString* num))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + + @end diff --git a/QXLive/Mine(音域)/Services/QXMineNetwork.m b/QXLive/Mine(音域)/Services/QXMineNetwork.m index ab7ebf4..089298b 100644 --- a/QXLive/Mine(音域)/Services/QXMineNetwork.m +++ b/QXLive/Mine(音域)/Services/QXMineNetwork.m @@ -1052,10 +1052,11 @@ failBlock(error,msg); }]; } -+(void)nextSongWithRoomId:(NSString *)room_id now_did:(NSString *)now_did successBlock:(void (^)(NSDictionary * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{ ++(void)nextSongWithRoomId:(NSString *)room_id now_did:(NSString *)now_did is_auto_next:(NSString*)is_auto_next successBlock:(void (^)(NSDictionary * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{ NSDictionary *parameters =@{ @"room_id":room_id, @"now_did":now_did?now_did:@"", + @"is_auto_next":is_auto_next?:@"" }; [[QXRequset shareInstance] postWithUrl:QXRoomNextSong parameters:parameters needCache:NO success:^(id responseObject) { if (successBlock) { @@ -2804,11 +2805,15 @@ }]; } -+(void)appKeepAliveWithRoomId:(NSString *)room_id{ ++(void)appKeepAliveWithRoomId:(NSString *)room_id + successBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ [[QXRequset shareInstance] getWithUrl:QXKeepAlive parameters:@{@"room_id":room_id?:@""} needCache:NO success:^(id responseObject) { - + if (successBlock) { + successBlock(responseObject[@"data"]); + } } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { - + failBlock(error,msg); }]; } @@ -2885,5 +2890,18 @@ }]; } - +/** + 每日任务未领取数量 + */ ++(void)appTaskWaitDrawSuccessBlock:(void (^)(NSString* num))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + [[QXRequset shareInstance] getWithUrl:QXAppTaskWaitDraw parameters:@{} needCache:NO success:^(id responseObject) { + if (successBlock) { + NSString *num = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"num"]]; + successBlock(num); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} @end diff --git a/QXLive/Mine(音域)/View/QXMineServiceCell.h b/QXLive/Mine(音域)/View/QXMineServiceCell.h index 79e73b6..03ac704 100644 --- a/QXLive/Mine(音域)/View/QXMineServiceCell.h +++ b/QXLive/Mine(音域)/View/QXMineServiceCell.h @@ -44,14 +44,16 @@ typedef NS_ENUM(NSInteger) { @property (nonatomic,weak)iddelegate; @property (nonatomic,assign)BOOL isMore; @property (nonatomic,assign)BOOL singerIsAuth; +@property (nonatomic,strong)NSString *taskNumber; +(instancetype)cellWithTableView:(UITableView *)tableView; @end @interface QXMineServiceSubCell : UICollectionViewCell @property (nonatomic,strong)UIImageView *imageView; @property (nonatomic,strong)UILabel *titleLabel; - +@property (nonatomic,strong)UILabel *unreadLabel; @property (nonatomic,strong)QXServiceModel *model; +@property (nonatomic,strong)NSString *unreadNum; @end diff --git a/QXLive/Mine(音域)/View/QXMineServiceCell.m b/QXLive/Mine(音域)/View/QXMineServiceCell.m index 43a42cd..9996990 100644 --- a/QXLive/Mine(音域)/View/QXMineServiceCell.m +++ b/QXLive/Mine(音域)/View/QXMineServiceCell.m @@ -17,6 +17,7 @@ @property (nonatomic,strong)QXServiceModel *inviteModel; @property (nonatomic,strong)QXServiceModel *singerAuthModel; @property (nonatomic,strong)QXServiceModel *songListModel; +@property (nonatomic,strong)QXServiceModel *taskModel; @end @implementation QXMineServiceCell @@ -145,6 +146,11 @@ _singerIsAuth = singerIsAuth; } +-(void)setTaskNumber:(NSString *)taskNumber{ + _taskNumber = taskNumber; + self.taskModel.unreadNumber = taskNumber; + [self.collectionView reloadData]; +} -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ return self.isMore?self.moreArray.count:self.serviceArray.count; } @@ -214,6 +220,7 @@ md2.title = @"每日任务"; md2.icon = @"service_task"; md2.type = QXMineServiceTypeDayTask; + self.taskModel = md2; QXServiceModel *md3 = [[QXServiceModel alloc] init]; md3.title = @"意见反馈"; @@ -309,6 +316,13 @@ _model = model; self.imageView.image = [UIImage imageNamed:model.icon]; self.titleLabel.text = model.title; + if (model.unreadNumber.integerValue <= 0) { + self.unreadLabel.text = @"0"; + self.unreadLabel.hidden = YES; + }else{ + self.unreadLabel.text = model.unreadNumber; + self.unreadLabel.hidden = NO; + } } -(void)initSubviews{ UIImageView *imageView = [[UIImageView alloc] init]; @@ -329,6 +343,32 @@ make.centerX.equalTo(self.contentView); make.height.mas_equalTo(17); }]; + + self.unreadLabel = [[UILabel alloc] init]; + self.unreadLabel.font = [UIFont systemFontOfSize:10]; + self.unreadLabel.textAlignment = NSTextAlignmentCenter; +// self.unreadLabel.text = @"99"; + self.unreadLabel.hidden = YES; + self.unreadLabel.textColor = RGB16(0xffffff); + self.unreadLabel.backgroundColor = RGB(255, 19, 55); + [self.unreadLabel addRoundedCornersWithRadius:10]; + [self.contentView addSubview:self.unreadLabel]; + [self.unreadLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(0); + make.right.mas_equalTo(-25); + make.width.mas_equalTo(18); + make.height.mas_equalTo(18); + }]; } +-(void)setUnreadNum:(NSString *)unreadNum{ + _unreadNum = unreadNum; + if (unreadNum.integerValue <= 0) { + self.unreadLabel.text = @"0"; + self.unreadLabel.hidden = YES; + }else{ + self.unreadLabel.text = unreadNum; + self.unreadLabel.hidden = NO; + } +} @end diff --git a/QXLive/Other/Assets.xcassets/mine/service_task.imageset/service_task@2x.png b/QXLive/Other/Assets.xcassets/mine/service_task.imageset/service_task@2x.png index 635747c..8c460ac 100644 Binary files a/QXLive/Other/Assets.xcassets/mine/service_task.imageset/service_task@2x.png and b/QXLive/Other/Assets.xcassets/mine/service_task.imageset/service_task@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/service_task.imageset/service_task@3x.png b/QXLive/Other/Assets.xcassets/mine/service_task.imageset/service_task@3x.png index 8e6fcd2..be6e05d 100644 Binary files a/QXLive/Other/Assets.xcassets/mine/service_task.imageset/service_task@3x.png and b/QXLive/Other/Assets.xcassets/mine/service_task.imageset/service_task@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/task_cp_no_data.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/task_cp_no_data.imageset/Contents.json new file mode 100644 index 0000000..8c2e4c6 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/task_cp_no_data.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "task_cp_no_data@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/task_cp_no_data.imageset/task_cp_no_data@2x.png b/QXLive/Other/Assets.xcassets/mine/task_cp_no_data.imageset/task_cp_no_data@2x.png new file mode 100644 index 0000000..af28778 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/task_cp_no_data.imageset/task_cp_no_data@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/Contents.json new file mode 100644 index 0000000..2fb75d9 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "task_lock_icon_nor@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "task_lock_icon_nor@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/task_lock_icon_nor@2x.png b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/task_lock_icon_nor@2x.png new file mode 100644 index 0000000..d42f411 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/task_lock_icon_nor@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/task_lock_icon_nor@3x.png b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/task_lock_icon_nor@3x.png new file mode 100644 index 0000000..f04bad8 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_nor.imageset/task_lock_icon_nor@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/Contents.json new file mode 100644 index 0000000..cf45523 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "task_lock_icon_sel@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "task_lock_icon_sel@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/task_lock_icon_sel@2x.png b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/task_lock_icon_sel@2x.png new file mode 100644 index 0000000..99a2e0a Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/task_lock_icon_sel@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/task_lock_icon_sel@3x.png b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/task_lock_icon_sel@3x.png new file mode 100644 index 0000000..2844740 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/task_lock_icon_sel.imageset/task_lock_icon_sel@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/task_master_no_data.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/task_master_no_data.imageset/Contents.json new file mode 100644 index 0000000..de2a47a --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/task_master_no_data.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "task_master_no_data@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/task_master_no_data.imageset/task_master_no_data@2x.png b/QXLive/Other/Assets.xcassets/mine/task_master_no_data.imageset/task_master_no_data@2x.png new file mode 100644 index 0000000..8e1583a Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/task_master_no_data.imageset/task_master_no_data@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@2x.png b/QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@2x.png index f31c43d..a849aed 100644 Binary files a/QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@2x.png and b/QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@3x.png b/QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@3x.png index 8652362..ab92742 100644 Binary files a/QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@3x.png and b/QXLive/Other/Assets.xcassets/room/room_day_task.imageset/room_day_task@3x.png differ diff --git a/QXLive/Other/QXApi.h b/QXLive/Other/QXApi.h index 89ceec8..d921fd0 100644 --- a/QXLive/Other/QXApi.h +++ b/QXLive/Other/QXApi.h @@ -560,5 +560,6 @@ static NSString * QXAppSignTask = @"api/Tasks/dailyTasksSignList"; static NSString * QXAppSign = @"api/Tasks/dailyTasksSign"; /// 每日签到 static NSString * QXAppSignStatus = @"api/Tasks/dailyTasksSignStatus"; - +/// 每日任务未领取数量 +static NSString * QXAppTaskWaitDraw = @"api/Tasks/dailyTasksUnReceiveCount"; #endif /* Api_h */ diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController+Friend.m b/QXLive/Room(房间)/Controller/QXRoomViewController+Friend.m index b3d071c..6fe0e1c 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController+Friend.m +++ b/QXLive/Room(房间)/Controller/QXRoomViewController+Friend.m @@ -86,6 +86,8 @@ QXRoomViewController *roomVc = [[QXRoomViewController alloc] init]; roomVc.roomId = QXGlobal.shareGlobal.superRoomId; [viewControllers insertObject:roomVc atIndex:i]; + QXGlobal.shareGlobal.roomVC = roomVc; + QXGlobal.shareGlobal.roomId = roomVc.roomId; break; } } diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController.h b/QXLive/Room(房间)/Controller/QXRoomViewController.h index 0417ecf..b2e22d9 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController.h +++ b/QXLive/Room(房间)/Controller/QXRoomViewController.h @@ -56,6 +56,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)QXTimePraizeView *timeView; /// 巡乐会 @property (nonatomic,strong)QXMeetActivityView *meetView; +/// 任务待领取数量 +@property (nonatomic,strong)NSString *taskWaitDrawNum; -(void)configBottomTools; -(void)stopHWDMP4; -(void)playHWDMP4; diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController.m b/QXLive/Room(房间)/Controller/QXRoomViewController.m index 7e424c8..2cce41b 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController.m +++ b/QXLive/Room(房间)/Controller/QXRoomViewController.m @@ -105,10 +105,6 @@ QXRoomUserInfoViewDelegate [QXGlobal.shareGlobal startKeepAlive]; // [self performSelector:@selector(test) afterDelay:5]; } -//-(void)test{ -// [self roomPKRecieveLoserWantToRunRoadWithUserInfo:nil]; -//27b36h -//} -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:YES animated:YES]; @@ -155,6 +151,7 @@ QXRoomUserInfoViewDelegate }); self.navigationController.viewControllers = marr; // self.navigationController.interactivePopGestureRecognizer.enabled = NO; + [self getTaskCount]; } -(void)viewDidDisappear:(BOOL)animated{ [super viewDidDisappear:animated]; @@ -301,20 +298,28 @@ QXRoomUserInfoViewDelegate }]; } +-(void)getTaskCount{ + MJWeakSelf + [QXMineNetwork appTaskWaitDrawSuccessBlock:^(NSString * _Nonnull num) { + [weakSelf setTaskWaitDrawNum:num]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; +} #pragma mark - 获取房间信息 -(void)joinRoom{ + MJWeakSelf if (self.roomModel) { [self resetSubviews]; [self configRoomDataIsJoin:YES]; }else{ - MJWeakSelf [[QXRoomMessageManager shared] joinGroupWithRoomId:self.roomId]; QXGlobal.shareGlobal.roomId = self.roomId; QXGlobal.shareGlobal.roomVC = self; [QXMineNetwork joinRoomWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) { weakSelf.roomModel = roomModel; - [self resetSubviews]; - [self configRoomDataIsJoin:YES]; + [weakSelf resetSubviews]; + [weakSelf configRoomDataIsJoin:YES]; } roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) { }failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { @@ -2134,5 +2139,10 @@ QXRoomUserInfoViewDelegate } return _dayTaskTagView; } + +-(void)setTaskWaitDrawNum:(NSString *)taskWaitDrawNum{ + _taskWaitDrawNum = taskWaitDrawNum; + self.dayTaskTagView.unreadNum = taskWaitDrawNum; +} @end diff --git a/QXLive/Room(房间)/View/QXRoomChatListView.m b/QXLive/Room(房间)/View/QXRoomChatListView.m index 62ee82a..e50db08 100644 --- a/QXLive/Room(房间)/View/QXRoomChatListView.m +++ b/QXLive/Room(房间)/View/QXRoomChatListView.m @@ -202,7 +202,22 @@ NSInteger maxMessageCount = 20; // [self.giftArray removeFirstObject]; // } #if DEBUG - if (model.messageType == QXRoomChatMessageTypeGift || model.messageType == QXRoomChatMessageTypeSystem || model.messageType == QXRoomChatMessageTypeChat) { +// if (model.messageType == QXRoomChatMessageTypeGift || model.messageType == QXRoomChatMessageTypeSystem || model.messageType == QXRoomChatMessageTypeChat) { +// NSString *text = @""; +// if (model.messageType == QXRoomChatMessageTypeGift || model.messageType == QXRoomChatMessageTypeSystem) { +// text = model.text; +// }else{ +// text = [NSString stringWithFormat:@"%@说:%@",model.FromUserInfo.nickname,model.text]; +// } +// AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:text]; +// utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-CN"]; +// utterance.rate = 0.5 ; +// utterance.pitchMultiplier = 1.0 ; +// utterance.volume = 1.0 ; +// [self.synthesizer speakUtterance:utterance]; +// } +#else + if (QXGlobal.shareGlobal.isAppStore) { NSString *text = @""; if (model.messageType == QXRoomChatMessageTypeGift || model.messageType == QXRoomChatMessageTypeSystem) { text = model.text; diff --git a/QXLive/Room(房间)/View/QXRoomTitleView.m b/QXLive/Room(房间)/View/QXRoomTitleView.m index 1ec1e6b..d6de1e8 100644 --- a/QXLive/Room(房间)/View/QXRoomTitleView.m +++ b/QXLive/Room(房间)/View/QXRoomTitleView.m @@ -414,6 +414,8 @@ QXRoomViewController *roomVc = [[QXRoomViewController alloc] init]; roomVc.roomId = QXGlobal.shareGlobal.superRoomId; [viewControllers insertObject:roomVc atIndex:i]; + QXGlobal.shareGlobal.roomVC = roomVc; + QXGlobal.shareGlobal.roomId = roomVc.roomId; break; } } diff --git a/QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.h b/QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.h index 7a126d2..1fcbccb 100644 --- a/QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.h +++ b/QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.h @@ -10,6 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @interface QXRoomDayTaskTagView : UIView +@property (nonatomic,strong)NSString *unreadNum; @property (nonatomic,copy)void(^startBlock)(void); @end diff --git a/QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.m b/QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.m index 05387ee..c0f0766 100644 --- a/QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.m +++ b/QXLive/Room(房间)/View/每日任务/QXRoomDayTaskTagView.m @@ -6,10 +6,12 @@ // #import "QXRoomDayTaskTagView.h" + @interface QXRoomDayTaskTagView() @property (nonatomic,strong)UIImageView *imageView; @property (nonatomic,strong)UILabel *timeLabel; @property (nonatomic,strong)UIButton *btn; +@property (nonatomic,strong)UILabel *unreadLabel; @end @implementation QXRoomDayTaskTagView @@ -17,7 +19,7 @@ { self = [super init]; if (self) { - self.frame = CGRectMake(SCREEN_WIDTH-80, SCREEN_HEIGHT-400, 80, 60); + self.frame = CGRectMake(SCREEN_WIDTH-80, SCREEN_HEIGHT-400, 80, 67); [self initSubviews]; } return self; @@ -25,7 +27,7 @@ -(void)initSubviews{ self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_day_task"]]; - self.imageView.frame = CGRectMake(0, 0, 80, 60); + self.imageView.frame = CGRectMake(0, 0, 80, 67); [self addSubview:self.imageView]; self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.imageView.bottom, self.width, 20)]; @@ -33,6 +35,23 @@ self.timeLabel.font = [UIFont systemFontOfSize:12]; self.timeLabel.textColor = RGB16(0xFFEBBD); [self addSubview:self.timeLabel]; + + self.unreadLabel = [[UILabel alloc] init]; + self.unreadLabel.font = [UIFont systemFontOfSize:10]; + self.unreadLabel.textAlignment = NSTextAlignmentCenter; +// self.unreadLabel.text = @"99"; + self.unreadLabel.hidden = YES; + self.unreadLabel.textColor = RGB16(0xffffff); + self.unreadLabel.backgroundColor = RGB(255, 19, 55); + [self.unreadLabel addRoundedCornersWithRadius:10]; + [self addSubview:self.unreadLabel]; + [self.unreadLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(5); + make.right.mas_equalTo(-5); + make.width.mas_equalTo(20); + make.height.mas_equalTo(20); + }]; + self.btn = [[UIButton alloc] initWithFrame:self.bounds]; [self.btn addTarget:self action:@selector(btnClick) forControlEvents:(UIControlEventTouchUpInside)]; [self addSubview:self.btn]; @@ -45,6 +64,17 @@ self.startBlock(); } } + +-(void)setUnreadNum:(NSString *)unreadNum{ + _unreadNum = unreadNum; + if (unreadNum.integerValue <= 0) { + self.unreadLabel.text = @"0"; + self.unreadLabel.hidden = YES; + }else{ + self.unreadLabel.text = unreadNum; + self.unreadLabel.hidden = NO; + } +} -(void)handlePan:(UIPanGestureRecognizer*)recognizer{ if (recognizer.state == UIGestureRecognizerStateEnded) { NSLog(@"拖动结束"); diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeCabinView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeCabinView.m index e30df89..03a4e06 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeCabinView.m +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeCabinView.m @@ -338,6 +338,8 @@ QXRoomViewController *roomVc = [[QXRoomViewController alloc] init]; roomVc.roomId = QXGlobal.shareGlobal.superRoomId; [viewControllers insertObject:roomVc atIndex:i]; + QXGlobal.shareGlobal.roomVC = roomVc; + QXGlobal.shareGlobal.roomId = roomVc.roomId; break; } } diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSongView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSongView.m index b1c43b3..47ec70d 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSongView.m +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSongView.m @@ -368,7 +368,7 @@ QXRoomSeatDelegate if ([self.songInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) { double time = progress/1000.0+1; if (ceil(time) >= self.songInfo.duration) { - [self nextAction]; + [self nextSongActionIsAuto:YES]; } } } @@ -658,16 +658,20 @@ QXRoomSeatDelegate } -(void)nextAction{ + [self nextSongActionIsAuto:NO]; +} + +-(void)nextSongActionIsAuto:(BOOL)isAuto{ if (self.songInfo) { - [QXMineNetwork nextSongWithRoomId:self.roomModel.room_info.room_id now_did:self.songInfo.did successBlock:^(NSDictionary * _Nonnull dict) { + [QXMineNetwork nextSongWithRoomId:self.roomModel.room_info.room_id now_did:self.songInfo.did is_auto_next:isAuto?@"1":@"0" successBlock:^(NSDictionary * _Nonnull dict) { showToast(@"成功"); // [[QXAgoraEngine sharedEngine] ktv_EndSing]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { showToast(msg); }]; } - } + -(void)endAction{ [QXMineNetwork endSongWithRoomId:self.roomModel.room_info.room_id successBlock:^(NSDictionary * _Nonnull dict) {