diff --git a/QXLive.xcodeproj/project.pbxproj b/QXLive.xcodeproj/project.pbxproj index aa17559..2b15caf 100644 --- a/QXLive.xcodeproj/project.pbxproj +++ b/QXLive.xcodeproj/project.pbxproj @@ -787,7 +787,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.1.7; + MARKETING_VERSION = 1.1.8; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -853,7 +853,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.1.7; + MARKETING_VERSION = 1.1.8; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m b/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m index cae85f0..f93d3e6 100644 --- a/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m +++ b/QXLive/HomePage(声播)/Controlller/QXHomeViewController.m @@ -29,6 +29,8 @@ #import "QXSystemNoticeViewController.h" #import "QXHotRoomViewController.h" #import "QXInvitePopView.h" +#import "QXMineNetwork.h" +#import "QXSignInAppView.h" @interface QXHomeViewController () @property (nonatomic, strong) JXPagerView *pagingView; @@ -60,6 +62,8 @@ @property (nonatomic,strong)QXRechargePermissionModel *permissionModel; @property (nonatomic,strong)QXRoomListModel *recommendRoom; +/// 今日签到状态 +@property (nonatomic,strong)NSString* signStatus; @end @implementation QXHomeViewController @@ -150,6 +154,7 @@ self.rechargePermissionView.hidden = YES; [self.view addSubview:self.rechargePermissionView]; [self getRecommendRoom]; + [self getSignStatus]; } - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; @@ -247,6 +252,14 @@ }]; } +-(void)getSignStatus{ + MJWeakSelf + [QXMineNetwork appSignTaskStatusSuccessBlock:^(NSString * _Nonnull status) { + weakSelf.signStatus = status; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; +} //-(void)firstAction{ // [self popnPeopleRechargeView]; @@ -318,41 +331,58 @@ if ([QXGlobal shareGlobal].isAppStore) { return; } - if (self.permissionModel.first_charge_permission.intValue != 1) { - [self popRecommendRoom]; - return; - } MJWeakSelf - QXFirstRechargeView *view = [[QXFirstRechargeView alloc] init]; - view.closeActionBlock = ^{ - [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{ - QXLOG(@"页面关闭"); + if (self.permissionModel.first_charge_permission.intValue == 1) { + QXFirstRechargeView *view = [[QXFirstRechargeView alloc] init]; + view.closeActionBlock = ^{ + [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{ + QXLOG(@"页面关闭"); + if (weakSelf.signStatus.intValue == 1) { + [weakSelf popRecommendRoom]; + }else{ + [weakSelf popSignTask]; + } + }]; + }; + view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) { + [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{ + QXLOG(@"页面关闭"); + QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; + QXRechargeListModel *model = [[QXRechargeListModel alloc] init]; + model.money = money; + recharge.selectedModel = model; + recharge.isPop = YES; + recharge.gift_bag_id = gift_bag_id; + recharge.isOnlyDisplayPayType = YES; + [recharge showInView:KEYWINDOW]; + }]; + }; + + view.refreshBlcock = ^{ + [weakSelf getRechargePermission]; + [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{ + QXLOG(@"页面关闭"); + }]; + }; + [[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{ + + }]; + }else{ + if (weakSelf.signStatus.intValue == 1) { [weakSelf popRecommendRoom]; - }]; + }else{ + [weakSelf popSignTask]; + } + } +} + +-(void)popSignTask{ + MJWeakSelf + QXSignInAppView *view = [[QXSignInAppView alloc] init]; + view.cancelBlock = ^{ + [weakSelf popRecommendRoom]; }; - view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) { - [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{ - QXLOG(@"页面关闭"); - QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; - QXRechargeListModel *model = [[QXRechargeListModel alloc] init]; - model.money = money; - recharge.selectedModel = model; - recharge.isPop = YES; - recharge.gift_bag_id = gift_bag_id; - recharge.isOnlyDisplayPayType = YES; - [recharge showInView:KEYWINDOW]; - }]; - }; - - view.refreshBlcock = ^{ - [weakSelf getRechargePermission]; - [[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{ - QXLOG(@"页面关闭"); - }]; - }; - [[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{ - - }]; + [view showInView:KEYWINDOW]; } -(void)popRecommendRoom{ diff --git a/QXLive/HomePage(声播)/Controlller/QXRankHomeSubVC.m b/QXLive/HomePage(声播)/Controlller/QXRankHomeSubVC.m index 0fd6cfd..95512b6 100644 --- a/QXLive/HomePage(声播)/Controlller/QXRankHomeSubVC.m +++ b/QXLive/HomePage(声播)/Controlller/QXRankHomeSubVC.m @@ -253,7 +253,7 @@ } -(UITableView *)tableView{ if (!_tableView) { - _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.rankTypeView.bottom+10, SCREEN_WIDTH, self.myRankView.top - self.rankTypeView.bottom-10) style:(UITableViewStyleGrouped)]; + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.rankTypeView.bottom+10, SCREEN_WIDTH, self.myRankView.top - self.rankTypeView.bottom-10) style:(UITableViewStylePlain)]; _tableView.dataSource = self; _tableView.delegate = self; _tableView.backgroundColor = [UIColor clearColor]; diff --git a/QXLive/HomePage(声播)/View/首页/排行榜/QXRankCPTopThreeView.m b/QXLive/HomePage(声播)/View/首页/排行榜/QXRankCPTopThreeView.m index 2d2f808..c08fa34 100644 --- a/QXLive/HomePage(声播)/View/首页/排行榜/QXRankCPTopThreeView.m +++ b/QXLive/HomePage(声播)/View/首页/排行榜/QXRankCPTopThreeView.m @@ -15,6 +15,7 @@ if (self) { self = [[[NSBundle mainBundle]loadNibNamed:@"QXRankCPTopThreeView" owner:nil options:nil] lastObject]; self.frame = frame; + self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; } return self; } diff --git a/QXLive/HomePage(声播)/View/首页/排行榜/QXRankCPTopThreeView.xib b/QXLive/HomePage(声播)/View/首页/排行榜/QXRankCPTopThreeView.xib index 4f0fe26..4cf8d97 100644 --- a/QXLive/HomePage(声播)/View/首页/排行榜/QXRankCPTopThreeView.xib +++ b/QXLive/HomePage(声播)/View/首页/排行榜/QXRankCPTopThreeView.xib @@ -10,11 +10,11 @@ - + - + @@ -131,13 +131,13 @@ - + - + @@ -150,7 +150,7 @@ - + @@ -163,21 +163,21 @@ - + - + - + @@ -202,14 +202,14 @@ - + - + @@ -379,6 +379,8 @@ + + diff --git a/QXLive/Manager/QXRoomMessageManager.h b/QXLive/Manager/QXRoomMessageManager.h index 008d910..1396372 100644 --- a/QXLive/Manager/QXRoomMessageManager.h +++ b/QXLive/Manager/QXRoomMessageManager.h @@ -25,6 +25,8 @@ typedef NS_ENUM(NSInteger) { QXRoomMessageTypeSendAndRecieveCpHeartSignal = 130, /// cp双向奔赴 QXRoomMessageTypeCpHeartFinished = 131, + /// 师徒任务 + QXRoomMessageTypeMasterTask = 132, /// 基础文本消息类型 QXRoomMessageTypeText = 1, diff --git a/QXLive/Manager/QXRoomMessageManager.m b/QXLive/Manager/QXRoomMessageManager.m index 10e1d7d..86abacd 100644 --- a/QXLive/Manager/QXRoomMessageManager.m +++ b/QXLive/Manager/QXRoomMessageManager.m @@ -791,6 +791,21 @@ }; } +-(void)showMasterTaskInviteAlertViewWithRoomId:(NSString*)roomId userId:(NSString*)userId{ + QXCustomAlertView *alertView = [[QXCustomAlertView alloc] init]; + alertView.autoDismissTime = 10; + [alertView showInView:KEYWINDOW title:@"温馨提示" message:@"您的师傅邀请您进入房间,您是否同意?" cancleTitle:@"拒绝" commitTitle:@"同意"]; + alertView.cancelBlock = ^{ + NSDictionary *dict = @{@"status":@"2",@"room_id":roomId?:@""}; + NSString *jsonStr = [dict jsonStringEncoded]; + [[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeMasterTask) userId:userId]; + }; + alertView.commitBlock = ^{ + QXLOG(@"进入房间"); + [[QXGlobal shareGlobal] joinRoomWithRoomId:roomId isRejoin:NO navagationController:(QXRoomNavigationController*)KEYWINDOW.rootViewController]; + }; +} + -(void)onRecvC2CTextMessage:(NSString *)msgID sender:(V2TIMUserInfo *)info text:(NSString *)text{ } @@ -823,6 +838,17 @@ NSDictionary *dict = [json jsonValueDecoded]; NSString *message = [NSString stringWithFormat:@"%@",dict[@"text1"]]; [self showCpFinishedAlertViewWithText:message]; + }else if (meesageType == QXRoomMessageTypeMasterTask){ + NSString *json = [NSString stringWithFormat:@"%@",msg.Text[@"text"]]; + NSDictionary *dict = [json jsonValueDecoded]; + NSString *status = [NSString stringWithFormat:@"%@",dict[@"status"]]; + if ([status isEqualToString:@"2"]) { + showToast(@"您的徒弟拒绝了您的邀请"); + }else if ([status isEqualToString:@"1"]){ + NSString *roomId = [NSString stringWithFormat:@"%@",dict[@"room_id"]]; + QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text]; + [self showMasterTaskInviteAlertViewWithRoomId:roomId userId:model.FromUserInfo.user_id]; + } } } -(void)onRecvGroupCustomMessage:(NSString *)msgID groupID:(NSString *)groupID sender:(V2TIMGroupMemberInfo *)info customData:(NSData *)data{ diff --git a/QXLive/Mine(音域)/Controller/QXMineViewController.m b/QXLive/Mine(音域)/Controller/QXMineViewController.m index d3898fe..7fa9436 100644 --- a/QXLive/Mine(音域)/Controller/QXMineViewController.m +++ b/QXLive/Mine(音域)/Controller/QXMineViewController.m @@ -171,8 +171,7 @@ }; v.authActionBlock = ^{ [[QXGlobal shareGlobal] hideViewBlock:^{ - QXRoomSingerAuthViewController *vc = [[QXRoomSingerAuthViewController alloc] init]; - vc.singer_status = weakSelf.userModel.singer_status; + QXRealNameViewController *vc = [[QXRealNameViewController alloc] init]; [weakSelf.navigationController pushViewController:vc animated:YES]; }]; }; diff --git a/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.h b/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.h index 2115b2b..40e9cd6 100644 --- a/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.h +++ b/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.h @@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN @interface QXUserHomePageViewController : QXBaseViewController @property (nonatomic,strong)NSString *user_id; @property (nonatomic,assign)BOOL isGiftWall; +/// 是否是相册 +@property (nonatomic,assign)BOOL isAlbum; @end NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m b/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m index dea294f..e327d3f 100644 --- a/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m +++ b/QXLive/Mine(音域)/Controller/个人主页/QXUserHomePageViewController.m @@ -79,6 +79,9 @@ if (self.isGiftWall) { self.categoryView.defaultSelectedIndex = 1; } + if (self.isAlbum) { + self.categoryView.defaultSelectedIndex = 2; + } self.categoryView.backgroundColor = [UIColor clearColor]; JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init]; indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"]; diff --git a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m index ca5a92e..b8c6e20 100644 --- a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m +++ b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m @@ -11,8 +11,15 @@ #import "QXDayTaskRuleView.h" #import "QXMineNetwork.h" #import "QXTaskGiftRecordVC.h" +#import "QXRealNameViewController.h" +#import "QXUserHomePageViewController.h" +#import "QXGuildViewController.h" +#import "QXWithDrawBindViewController.h" +#import "QXRechargeViewcController.h" +#import "QXSignInAppView.h" +#import "QXCreatPhotosViewController.h" -@interface QXTaskViewController () +@interface QXTaskViewController () @property (nonatomic,strong)QXDayTaskTopView *topView; @property (nonatomic,strong)UITableView *tableView; @property (nonatomic,strong)QXDayTaskModel *model; @@ -42,7 +49,7 @@ } - (void)initSubViews{ self.bgImageHidden = YES; - self.view.backgroundColor = RGB16(0xD7CDFF); + self.view.backgroundColor = RGB16(0xE3FAE4); self.tableView.tableHeaderView = self.topView; [self.view addSubview:self.tableView]; } @@ -51,6 +58,15 @@ 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]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { @@ -69,43 +85,95 @@ return _topView; } +-(void)didClickFinishTaskWithModel:(QXDayTaskListModel *)taskModel{ + if ([taskModel.task_id isEqualToString:@"1"]) { + QXSignInAppView *signView = [[QXSignInAppView alloc] init]; + [signView showInView:self.view]; + return; + } + if (taskModel.task_status.intValue == 1) { +// if (taskModel.task_id.intValue == 9 || taskModel.task_id.intValue == 10) { +//// QXGlobal.shareGlobal.taskModel = self.model; +// if ([[QXGlobal shareGlobal].roomId isEqualToString:taskModel.from_id]) { +// [[QXGlobal shareGlobal] popToRoomViewController]; +// } +// [[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController]; +// } + if (taskModel.jump_type.intValue == 0) { + return; + }else if (taskModel.jump_type.intValue == 1) { + QXRealNameViewController *vc = [[QXRealNameViewController alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; + return; + }else if (taskModel.jump_type.intValue == 2) { + QXCreatPhotosViewController *vc = [[QXCreatPhotosViewController alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; + return; + }else if (taskModel.jump_type.intValue == 3) { + QXWithDrawBindViewController *vc = [[QXWithDrawBindViewController alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; + return; + }else if (taskModel.jump_type.intValue == 4) { +// if (taskModel.from_id.longLongValue > 0) { + showLoadingInView(self.view); + [QXMineNetwork getRoomTaskJumpRoomWithTaskId:taskModel.task_id successBlock:^(NSString * _Nonnull roomId) { + hideLoadingInView(self.view); + if (roomId.longLongValue > 0) { + NSDictionary *dict = @{@"status":@"1",@"room_id":taskModel.from_id?:@""}; + NSString *jsonStr = [dict jsonStringEncoded]; + [[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeMasterTask) userId:taskModel.student_id]; + [QXGlobal.shareGlobal joinRoomWithRoomId:roomId isRejoin:NO navagationController:self.navigationController]; + }else{ + showToast(@"暂无此类型房间"); + } + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + hideLoadingInView(self.view); + showToast(msg); + }]; +// }else{ +// showToast(@"暂无此类型房间"); +// } + return; + }else if (taskModel.jump_type.intValue == 5) { + QXGuildViewController *vc = [[QXGuildViewController alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; + return; + }else if (taskModel.jump_type.intValue == 6) { + QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init]; + [self.navigationController pushViewController:vc animated:YES]; + return; + }else if (taskModel.jump_type.intValue == 7) { + + } + + }else if (taskModel.task_status.intValue == 2) { + MJWeakSelf + [QXMineNetwork dayTaskDrawWithTaskId:taskModel.task_id student_id:taskModel.student_id successBlock:^(NSDictionary * _Nonnull dict) { + showToast(@"领取成功"); + [weakSelf getDayTask]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; + } +} + #pragma mark - UITableViewDataSource,UITableViewDelegate -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ if (self.model == nil) { return 0; } - if (self.model.tasks.teacher_tasks.count > 0) { - return 4; - }else{ - return 3; - } - + return self.model.tasks.count; } -(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 if(section == 2){ - return self.model.tasks.usual_tasks.count; - }else{ - return self.model.tasks.teacher_tasks.count; - } - + QXDayTaskTypeModel *model = self.model.tasks[section]; + return model.task_list.count; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ QXDayTaskCell *cell = [QXDayTaskCell cellWithTableView:tableView]; - QXDayTaskListModel *model; - if (indexPath.section == 0) { - model = self.model.tasks.daily_tasks[indexPath.row]; - }else if(indexPath.section == 1){ - model = self.model.tasks.daily_tasks_special[indexPath.row]; - }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; + QXDayTaskTypeModel *model = self.model.tasks[indexPath.section]; + QXDayTaskListModel *taskModel = model.task_list[indexPath.row]; + cell.model = taskModel; + cell.delegate = self; return cell; } -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ @@ -115,15 +183,8 @@ UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 12, SCREEN_WIDTH-32*2, 23)]; titleLabel.font = [UIFont boldSystemFontOfSize:16]; titleLabel.textColor = QXConfig.textColor; - if (section == 0) { - titleLabel.text = QXText(@"每日任务"); - }else if(section == 1){ - titleLabel.text = QXText(@"特殊任务"); - }else if(section == 2){ - titleLabel.text = QXText(@"平台任务"); - }else{ - titleLabel.text = QXText(@"师徒任务"); - } + QXDayTaskTypeModel *model = self.model.tasks[section]; + titleLabel.text = model.task_type_name; [header addSubview:titleLabel]; return header; } @@ -142,6 +203,15 @@ -(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]; + if ([taskModel.task_id isEqualToString:@"1"]) { + QXSignInAppView *signView = [[QXSignInAppView alloc] init]; + [signView showInView:self.view]; + return; + } +} -(UITableView *)tableView{ if (!_tableView) { @@ -149,7 +219,8 @@ _tableView.dataSource = self; _tableView.delegate = self; _tableView.backgroundColor = [UIColor clearColor]; - _tableView.rowHeight = 60; +// _tableView.estimatedRowHeight = 60; + _tableView.rowHeight = UITableViewAutomaticDimension; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; if (@available(iOS 15.0, *)) { _tableView.sectionHeaderTopPadding = 0; diff --git a/QXLive/Mine(音域)/Model/QXDayTaskModel.h b/QXLive/Mine(音域)/Model/QXDayTaskModel.h index 4ace523..4d7f87a 100644 --- a/QXLive/Mine(音域)/Model/QXDayTaskModel.h +++ b/QXLive/Mine(音域)/Model/QXDayTaskModel.h @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN /// 盲盒信息 @property(nonatomic,strong)NSArray *gift_box_list; -@property(nonatomic,strong)QXDayTaskTypeModel*tasks; +@property(nonatomic,strong)NSArray* tasks; @end @@ -41,15 +41,17 @@ NS_ASSUME_NONNULL_BEGIN @end @interface QXDayTaskTypeModel : NSObject -/// 每日特殊任务2 -@property(nonatomic,strong)NSArray *daily_tasks_special; -/// 每日常规任务 -@property(nonatomic,strong)NSArray *daily_tasks; -/// 平台任务列表 -@property(nonatomic,strong)NSArray *usual_tasks; - -@property(nonatomic,strong)NSArray *teacher_tasks; - +///// 每日特殊任务2 +//@property(nonatomic,strong)NSArray *daily_tasks_special; +///// 每日常规任务 +//@property(nonatomic,strong)NSArray *daily_tasks; +///// 平台任务列表 +//@property(nonatomic,strong)NSArray *usual_tasks; +// +//@property(nonatomic,strong)NSArray *teacher_tasks; +@property(nonatomic,strong)NSString *task_type_name; +@property(nonatomic,strong)NSString *task_type_id; +@property(nonatomic,strong)NSArray*task_list; @end @interface QXDayTaskListModel : NSObject @@ -76,7 +78,23 @@ NS_ASSUME_NONNULL_BEGIN /// 0 记录次数 1 计时 @property(nonatomic,strong)NSString *is_time; /// 奖励类型 1金币 2钻石 -@property(nonatomic,strong)NSString *reward_type; +//@property(nonatomic,strong)NSString *reward_type; +/// 任务奖励 +@property(nonatomic,strong)NSString *reward_str; +/** +0 不跳转 +1 跳转实名 +2 跳转我的相册 +3 跳转绑定管理 +4 跳转房间 +5 跳转申请加入公会 +6 跳转充值 +7 签到 + */ +@property(nonatomic,strong)NSString *jump_type; +/// 徒弟user id +@property(nonatomic,strong)NSString *student_id; + @end @@ -89,4 +107,26 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic,strong)NSString *createtime; @end +@interface QXSignAppModel : NSObject +/// 第几天 +@property(nonatomic,strong)NSString *day; +/// 日期 +@property(nonatomic,strong)NSString *sign_in_date; +/// 签到状态:1已签到 0未签到 +@property(nonatomic,strong)NSString *sign_in_status; +/// 初级礼盒 +@property(nonatomic,strong)NSString *sign_in_status_str; +/// 是否是当天 0否 1是 +@property(nonatomic,strong)NSString *is_today; +/// 礼物名称 +@property(nonatomic,strong)NSString *gift_name; +/// 数量 +@property(nonatomic,strong)NSString *num; +/// 价格 +@property(nonatomic,strong)NSString *gift_price; +/// 1金币 2礼物 3装扮 4钻石 +@property(nonatomic,strong)NSString *type; +/// 礼物 +@property(nonatomic,strong)NSString *base_image; +@end NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/Model/QXDayTaskModel.m b/QXLive/Mine(音域)/Model/QXDayTaskModel.m index 9ef7e3f..98de410 100644 --- a/QXLive/Mine(音域)/Model/QXDayTaskModel.m +++ b/QXLive/Mine(音域)/Model/QXDayTaskModel.m @@ -25,10 +25,10 @@ +(NSDictionary *)modelContainerPropertyGenericClass{ return @{ - @"daily_tasks" : @"QXDayTaskListModel", - @"usual_tasks" : @"QXDayTaskListModel", - @"daily_tasks_special": @"QXDayTaskListModel", - @"teacher_tasks": @"QXDayTaskListModel", + @"task_list" : @"QXDayTaskListModel", +// @"usual_tasks" : @"QXDayTaskListModel", +// @"daily_tasks_special": @"QXDayTaskListModel", +// @"teacher_tasks": @"QXDayTaskListModel", }; } @@ -43,4 +43,10 @@ +@end + +@implementation QXSignAppModel + + + @end diff --git a/QXLive/Mine(音域)/Model/QXGiftModel.h b/QXLive/Mine(音域)/Model/QXGiftModel.h index 007d6ca..2a0419c 100644 --- a/QXLive/Mine(音域)/Model/QXGiftModel.h +++ b/QXLive/Mine(音域)/Model/QXGiftModel.h @@ -33,9 +33,12 @@ NS_ASSUME_NONNULL_BEGIN /// 是否为爵位礼物 0 打开 1 锁住 @property (nonatomic,strong)NSString *is_lock; -/// 是否为爵位礼物 0 打开 1 锁住 +/// 是否为cp礼物 0 打开 1 锁住 @property (nonatomic,strong)NSString *is_cp; +/// 是否为师徒标签 +@property (nonatomic,strong)NSString *is_teacher; + @property (nonatomic,assign)BOOL isSelected; @end diff --git a/QXLive/Mine(音域)/Services/QXMineNetwork.h b/QXLive/Mine(音域)/Services/QXMineNetwork.h index 56939d7..4c0d743 100644 --- a/QXLive/Mine(音域)/Services/QXMineNetwork.h +++ b/QXLive/Mine(音域)/Services/QXMineNetwork.h @@ -947,6 +947,7 @@ NS_ASSUME_NONNULL_BEGIN 领取任务金币 */ +(void)dayTaskDrawWithTaskId:(NSString*)task_id + student_id:(NSString*)student_id successBlock:(void (^)(NSDictionary* dict))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock; /** @@ -1402,6 +1403,32 @@ NS_ASSUME_NONNULL_BEGIN +(void)signRoomRefuseSignWithRoomId:(NSString*)roomId successBlock:(void (^)(NSDictionary* dict))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 每日任务跳转房间 + */ ++(void)getRoomTaskJumpRoomWithTaskId:(NSString*)task_id + successBlock:(void (^)(NSString* roomId))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 每日签到状态 + */ ++(void)getAppSignTaskListSuccessBlock:(void (^)(NSArray* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 每日签到 + */ ++(void)appSignTaskSuccessBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + +/** + 每日签到状态 + */ ++(void)appSignTaskStatusSuccessBlock:(void (^)(NSString* status))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock; + @end diff --git a/QXLive/Mine(音域)/Services/QXMineNetwork.m b/QXLive/Mine(音域)/Services/QXMineNetwork.m index 3c84149..ab7ebf4 100644 --- a/QXLive/Mine(音域)/Services/QXMineNetwork.m +++ b/QXLive/Mine(音域)/Services/QXMineNetwork.m @@ -1870,10 +1870,12 @@ 领取任务金币 */ +(void)dayTaskDrawWithTaskId:(NSString*)task_id + student_id:(NSString*)student_id successBlock:(void (^)(NSDictionary* dict))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ NSDictionary *parameters =@{ - @"task_id":task_id?task_id:@"" + @"task_id":task_id?task_id:@"", + @"student_id":student_id?:@"" }; [[QXRequset shareInstance] postWithUrl:QXDayDrawTaskCoin parameters:parameters needCache:NO success:^(id responseObject) { if (successBlock) { @@ -2825,5 +2827,63 @@ }]; } +/** + 每日任务跳转房间 + */ ++(void)getRoomTaskJumpRoomWithTaskId:(NSString*)task_id + successBlock:(void (^)(NSString* roomId))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + [[QXRequset shareInstance] getWithUrl:QXRoomTaskJumpRoom parameters:@{@"task_id":task_id?:@""} needCache:NO success:^(id responseObject) { + if (successBlock) { + NSString *roomId = [NSString stringWithFormat:@"%@",responseObject[@"data"]]; + successBlock(roomId); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} +/** + 每日签到状态 + */ ++(void)getAppSignTaskListSuccessBlock:(void (^)(NSArray* list))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + [[QXRequset shareInstance] getWithUrl:QXAppSignTask parameters:@{} needCache:NO success:^(id responseObject) { + if (successBlock) { + NSArray *list = [NSArray yy_modelArrayWithClass:[QXSignAppModel class] json:responseObject[@"data"]]; + successBlock(list); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + +/** + 每日签到 + */ ++(void)appSignTaskSuccessBlock:(void (^)(NSDictionary* dict))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + [[QXRequset shareInstance] getWithUrl:QXAppSign parameters:@{} needCache:NO success:^(id responseObject) { + if (successBlock) { + successBlock(responseObject[@"data"]); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} +/** + 每日签到状态 + */ ++(void)appSignTaskStatusSuccessBlock:(void (^)(NSString* status))successBlock + failBlock:(void (^)(NSError * error, NSString * msg))failBlock{ + [[QXRequset shareInstance] getWithUrl:QXAppSignStatus parameters:@{} needCache:NO success:^(id responseObject) { + if (successBlock) { + NSString *status = [NSString stringWithFormat:@"%@",responseObject[@"data"]]; + successBlock(status); + } + } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { + failBlock(error,msg); + }]; +} + @end diff --git a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.h b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.h index 34a56b7..33cd27a 100644 --- a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.h +++ b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.h @@ -8,7 +8,13 @@ #import #import "QXDayTaskModel.h" NS_ASSUME_NONNULL_BEGIN +@protocol QXDayTaskCellDelegate +@optional + +-(void)didClickFinishTaskWithModel:(QXDayTaskListModel *)taskModel; + +@end @interface QXDayTaskCell : UITableViewCell @property (weak, nonatomic) IBOutlet UIImageView *iconImageView; @property (weak, nonatomic) IBOutlet UILabel *titleLabel; @@ -16,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN @property (weak, nonatomic) IBOutlet UIButton *finishBtn; @property (strong, nonatomic) QXDayTaskListModel *model; + +@property (weak, nonatomic) iddelegate; +(instancetype)cellWithTableView:(UITableView *)tableView; @end diff --git a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m index b5acc8c..24f1f36 100644 --- a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m +++ b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m @@ -21,15 +21,16 @@ -(void)setModel:(QXDayTaskListModel *)model{ _model = model; self.titleLabel.text = model.task_name; - 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; +// 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:model.reward_str]; +// [attr yy_setColor:RGB16(0xFF8827) range:[subTitle rangeOfString:[NSString stringWithFormat:@"+%@",model.gold_reward]]]; + self.subTitleLabel.text = [model.reward_str isExist]?model.reward_str:@" "; + [self.finishBtn setTitle:model.task_type_str forState:(UIControlStateNormal)]; [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.icon]]; if (model.task_status.intValue == 1) { self.finishBtn.enabled = YES; @@ -46,38 +47,21 @@ } } - (IBAction)finishAction:(id)sender { - if (self.model.task_status.intValue == 1) { - if (self.model.task_id.intValue == 9 || self.model.task_id.intValue == 10) { - QXGlobal.shareGlobal.taskModel = self.model; - if ([[QXGlobal shareGlobal].roomId isEqualToString:self.model.from_id]) { - [[QXGlobal shareGlobal] popToRoomViewController]; - } - [[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController]; - } - }else if (self.model.task_status.intValue == 2) { - MJWeakSelf - [QXMineNetwork dayTaskDrawWithTaskId:self.model.task_id successBlock:^(NSDictionary * _Nonnull dict) { - showToast(@"领取成功"); - weakSelf.model.task_status = @"3"; - weakSelf.finishBtn.selected = NO; - weakSelf.finishBtn.enabled = NO; - } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { - showToast(msg); - }]; + if (self.delegate && [self.delegate respondsToSelector:@selector(didClickFinishTaskWithModel:)]) { + [self.delegate didClickFinishTaskWithModel:self.model]; } - } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code [self.finishBtn addRoundedCornersWithRadius:15]; - [self.finishBtn setTitleColor:RGB16(0xC134EE) forState:(UIControlStateNormal)]; + [self.finishBtn setTitleColor:RGB16(0x3ABC6D) forState:(UIControlStateNormal)]; [self.finishBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateSelected)]; [self.finishBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateDisabled)]; - [self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xC134EE)] forState:(UIControlStateSelected)]; + [self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x3ABC6D)] forState:(UIControlStateSelected)]; [self.finishBtn setBackgroundImage:[UIImage imageWithColor:UIColor.clearColor] forState:(UIControlStateNormal)]; [self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xF1F2F3)] forState:(UIControlStateDisabled)]; - self.finishBtn.layer.borderColor = RGB16(0xC134EE).CGColor; + self.finishBtn.layer.borderColor = RGB16(0x3ABC6D).CGColor; self.finishBtn.layer.borderWidth = 1; } diff --git a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.xib b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.xib index d432eb1..63fa15a 100644 --- a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.xib +++ b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.xib @@ -10,7 +10,7 @@ - + @@ -18,23 +18,23 @@ - + - - + + - - - - - - - - - - + + + + + + + + + + + - - - diff --git a/QXLive/Mine(音域)/View/每日任务/QXSignInAppView.h b/QXLive/Mine(音域)/View/每日任务/QXSignInAppView.h new file mode 100644 index 0000000..68c9513 --- /dev/null +++ b/QXLive/Mine(音域)/View/每日任务/QXSignInAppView.h @@ -0,0 +1,39 @@ +// +// QXSignInAppView.h +// QXLive +// +// Created by 启星 on 2025/12/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface QXSignInAppView : UIView +@property (nonatomic,copy)void(^cancelBlock)(void); +-(void)showInView:(UIView *)view; + +-(void)hide; + +@end + +@interface QXSignInAppSubView : UIView +@property (nonatomic,strong)UIImageView *bgImageView; +@property (nonatomic,strong)UILabel *dayLabel; +@property (nonatomic,strong)UILabel *dayTitleLabel; +@property (nonatomic,strong)UIImageView *statusImageView; +@property (nonatomic,strong)UIImageView *giftImageView; +@property (nonatomic,strong)UILabel *giftNameLabel; +@property (nonatomic,strong)QXSignAppModel *model; +@end + + +@interface QXSignInAppResultView : UIView +@property (nonatomic,strong)UIImageView *giftImageView; +@property (nonatomic,strong)UILabel *giftNameLabel; +@property (nonatomic,strong)QXSignAppModel *model; +@property (nonatomic,strong)UIButton *happyBtn; +@property (nonatomic,copy)void(^happyBlock)(void); +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Mine(音域)/View/每日任务/QXSignInAppView.m b/QXLive/Mine(音域)/View/每日任务/QXSignInAppView.m new file mode 100644 index 0000000..915174c --- /dev/null +++ b/QXLive/Mine(音域)/View/每日任务/QXSignInAppView.m @@ -0,0 +1,407 @@ +// +// QXSignInAppView.m +// QXLive +// +// Created by 启星 on 2025/12/11. +// + +#import "QXSignInAppView.h" +#import "QXMineNetwork.h" +@interface QXSignInAppView() +@property (nonatomic,strong)UIView *bgView; +@property (nonatomic,strong)UIImageView *bgImageView; +@property (nonatomic,strong)QXSignInAppSubView *signView1; +@property (nonatomic,strong)QXSignInAppSubView *signView2; +@property (nonatomic,strong)QXSignInAppSubView *signView3; +@property (nonatomic,strong)QXSignInAppSubView *signView4; +@property (nonatomic,strong)QXSignInAppSubView *signView5; +@property (nonatomic,strong)QXSignInAppSubView *signView6; +@property (nonatomic,strong)QXSignInAppSubView *signView7; +@property (nonatomic,strong)NSMutableArray *signViewArray; + +@property (nonatomic,strong)UIButton *signBtn; +@property (nonatomic,strong)UIButton *closeBtn; + +@property (nonatomic,strong)QXSignAppModel*todayModel; + +@property (nonatomic,strong)QXSignInAppResultView *resultView; +@end +@implementation QXSignInAppView + +- (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.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5]; + self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-ScaleWidth(331))/2.0, -self.height, ScaleWidth(331), ScaleWidth(446)+50)]; +// self.bgView.backgroundColor = [UIColor whiteColor]; + self.bgView.layer.masksToBounds = YES; + self.bgView.layer.cornerRadius = 16; + [self addSubview:self.bgView]; + + + self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"app_sign_task_bg"]]; + [self.bgView addSubview:self.bgImageView]; + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.equalTo(self.bgView); + make.height.mas_equalTo(ScaleWidth(446)); + }]; + + self.signView1 = [[QXSignInAppSubView alloc] init]; + [self.signView1 addRoundedCornersWithRadius:4]; + [self.bgView addSubview:self.signView1]; + + self.signView2 = [[QXSignInAppSubView alloc] init]; + [self.signView2 addRoundedCornersWithRadius:4]; + [self.bgView addSubview:self.signView2]; + + self.signView3 = [[QXSignInAppSubView alloc] init]; + [self.signView3 addRoundedCornersWithRadius:4]; + [self.bgView addSubview:self.signView3]; + + self.signView4 = [[QXSignInAppSubView alloc] init]; + [self.signView4 addRoundedCornersWithRadius:4]; + [self.bgView addSubview:self.signView4]; + + self.signView5 = [[QXSignInAppSubView alloc] init]; + [self.signView5 addRoundedCornersWithRadius:4]; + [self.bgView addSubview:self.signView5]; + + self.signView6 = [[QXSignInAppSubView alloc] init]; + [self.signView6 addRoundedCornersWithRadius:4]; + [self.bgView addSubview:self.signView6]; + + self.signView7 = [[QXSignInAppSubView alloc] init]; + [self.signView7 addRoundedCornersWithRadius:4]; + [self.bgView addSubview:self.signView7]; + + + CGFloat leftMargin = ScaleWidth(22); + CGFloat itemSpace = ScaleWidth(6); + CGFloat itemWidth = (self.bgView.width - leftMargin*2 - itemSpace*3)/4; + CGFloat itemHeight = ScaleWidth(88); + [self.signView1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(leftMargin); + make.width.mas_equalTo(itemWidth); + make.height.mas_equalTo(itemHeight); + make.top.mas_equalTo(ScaleWidth(168)); + }]; + + [self.signView2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.signView1); + make.left.equalTo(self.signView1.mas_right).offset(itemSpace); + make.width.mas_equalTo(itemWidth); + make.height.mas_equalTo(itemHeight); + }]; + + + [self.signView3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.signView1); + make.left.equalTo(self.signView2.mas_right).offset(itemSpace); + make.width.mas_equalTo(itemWidth); + make.height.mas_equalTo(itemHeight); + }]; + + + [self.signView4 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.signView1); + make.left.equalTo(self.signView3.mas_right).offset(itemSpace); + make.width.mas_equalTo(itemWidth); + make.height.mas_equalTo(itemHeight); + }]; + + + [self.signView5 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.signView1.mas_bottom).offset(ScaleWidth(10)); + make.left.equalTo(self.signView1); + make.width.mas_equalTo(itemWidth); + make.height.mas_equalTo(itemHeight); + }]; + + [self.signView6 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.signView5); + make.left.equalTo(self.signView5.mas_right).offset(itemSpace); + make.width.mas_equalTo(itemWidth); + make.height.mas_equalTo(itemHeight); + }]; + + [self.signView7 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.signView5); + make.left.equalTo(self.signView6.mas_right).offset(itemSpace); + make.right.mas_equalTo(-leftMargin); + make.height.mas_equalTo(itemHeight); + }]; + + [self.signViewArray addObject:self.signView1]; + [self.signViewArray addObject:self.signView2]; + [self.signViewArray addObject:self.signView3]; + [self.signViewArray addObject:self.signView4]; + [self.signViewArray addObject:self.signView5]; + [self.signViewArray addObject:self.signView6]; + [self.signViewArray addObject:self.signView7]; + + self.signBtn = [[UIButton alloc] init]; + [self.signBtn setBackgroundImage:[UIImage imageNamed:@"sign_app_btn_bg"] forState:(UIControlStateNormal)]; + [self.signBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x999999)] forState:(UIControlStateDisabled)]; + [self.signBtn setTitle:@"立即签到" forState:(UIControlStateNormal)]; + [self.signBtn setTitle:@"已签到" forState:(UIControlStateDisabled)]; + [self.signBtn addTarget:self action:@selector(signAction) forControlEvents:(UIControlEventTouchUpInside)]; + self.signBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14]; + [self.signBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)]; + [self.signBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateDisabled)]; + [self.signBtn addRoundedCornersWithRadius:25]; + [self.bgView addSubview:self.signBtn]; + [self.signBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(ScaleWidth(257)); + make.height.mas_equalTo(50); + make.centerX.equalTo(self.bgView); + make.bottom.equalTo(self.bgImageView.mas_bottom).offset(-ScaleWidth(20)); + }]; + + + self.closeBtn = [[UIButton alloc] init]; + [self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)]; + [self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)]; + [self.bgView addSubview:self.closeBtn]; + [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(35); + make.height.mas_equalTo(35); + make.centerX.equalTo(self.bgView); + make.bottom.equalTo(self.bgView); + }]; + + [self addSubview:self.resultView]; + self.resultView.hidden = YES; + [self.resultView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.equalTo(self.signView1); + make.right.equalTo(self.signView4); + make.bottom.equalTo(self.signBtn); + }]; +} + +-(void)signAction{ + MJWeakSelf + [QXMineNetwork appSignTaskSuccessBlock:^(NSDictionary * _Nonnull dict) { + weakSelf.resultView.hidden = NO; + [weakSelf getSignTaskList]; + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + showToast(msg); + }]; + +} + +-(void)getSignTaskList{ + MJWeakSelf + [QXMineNetwork getAppSignTaskListSuccessBlock:^(NSArray * _Nonnull list) { + if (list.count == weakSelf.signViewArray.count) { + for (int i = 0;i < list.count; i++) { + QXSignAppModel*md = list[i]; + QXSignInAppSubView *signView = weakSelf.signViewArray[i]; + signView.model = md; + if (md.is_today.intValue == 1) { + weakSelf.todayModel = md; + weakSelf.resultView.model = weakSelf.todayModel; + if (md.sign_in_status.intValue == 1) { + weakSelf.signBtn.enabled = NO; + }else{ + weakSelf.signBtn.enabled = YES; + } + } + } + } + } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { + + }]; +} + +-(void)closeAction{ + if (self.cancelBlock) { + self.cancelBlock(); + } + [self hide]; +} +-(void)showInView:(UIView *)view{ + [self getSignTaskList]; + [view addSubview:self]; + [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ + self.bgView.y = (SCREEN_HEIGHT-ScaleWidth(446))/2.0-60; + } completion:^(BOOL finished) { + + }]; +} + +-(void)hide{ + [UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ + self.bgView.y = SCREEN_HEIGHT; + } completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; +} + +-(NSMutableArray *)signViewArray{ + if (!_signViewArray) { + _signViewArray = [NSMutableArray array]; + } + return _signViewArray; +} +-(QXSignInAppResultView *)resultView{ + if (!_resultView) { + _resultView = [[QXSignInAppResultView alloc] init]; + MJWeakSelf + _resultView.happyBlock = ^{ + [weakSelf closeAction]; + }; + } + return _resultView; +} +@end + + +@implementation QXSignInAppSubView + +- (instancetype)init +{ + self = [super init]; + if (self) { + [self initSubviews]; + } + return self; +} +-(void)setModel:(QXSignAppModel *)model{ + _model = model; + self.dayLabel.text = model.day; + if (model.sign_in_status.intValue == 1) { + self.statusImageView.hidden = NO; + self.statusImageView.image = [UIImage imageNamed:@"app_sign_drawed"]; + self.alpha = 0.5; + }else{ + self.statusImageView.hidden = YES; + self.alpha = 1; + } + self.giftNameLabel.text = [NSString stringWithFormat:@"%@%@",model.gift_name,model.num]; + [self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]]; + +} +-(void)initSubviews{ + self.bgImageView = [[UIImageView alloc] init]; + self.bgImageView.backgroundColor = RGB16(0xD3FFC8); + [self addSubview:self.bgImageView]; + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + + self.dayLabel = [[UILabel alloc] init]; + self.dayLabel.textColor = RGB16(0xFFC273); + self.dayLabel.font = [UIFont fontWithName:@"YouSheBiaoTiHei" size:32]; + [self addSubview:self.dayLabel]; + [self.dayLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self).offset(-5); + make.left.mas_equalTo(5); + }]; + + + self.dayTitleLabel = [[UILabel alloc] init]; + self.dayTitleLabel.textColor = RGB16(0xFFC273); + self.dayTitleLabel.font = [UIFont systemFontOfSize:12]; + self.dayTitleLabel.text = @"DAY"; + [self addSubview:self.dayTitleLabel]; + [self.dayTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self).offset(10); + make.left.equalTo(self.dayLabel.mas_right).offset(3); + }]; + + self.giftImageView = [[UIImageView alloc] init]; + self.giftImageView.contentMode = UIViewContentModeScaleAspectFit; + [self addSubview:self.giftImageView]; + [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(38); + make.centerX.centerY.equalTo(self); + }]; + + self.giftNameLabel = [[UILabel alloc] init]; + self.giftNameLabel.textColor = RGB16(0x999999); + self.giftNameLabel.textAlignment = NSTextAlignmentCenter; + self.giftNameLabel.font = [UIFont systemFontOfSize:12]; + self.giftNameLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; + [self addSubview:self.giftNameLabel]; + [self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.equalTo(self); + make.bottom.mas_equalTo(-6); + }]; + + self.statusImageView = [[UIImageView alloc] init]; + [self addSubview:self.statusImageView]; + [self.statusImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(ScaleWidth(32)); + make.centerX.centerY.equalTo(self); + }]; +} + +@end + + +@implementation QXSignInAppResultView + +- (instancetype)init +{ + self = [super init]; + if (self) { + [self initSubviews]; + } + return self; +} +-(void)setModel:(QXSignAppModel *)model{ + _model = model; + [self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]]; + self.giftNameLabel.text = [NSString stringWithFormat:@"签到成功 %@%@",model.gift_name,model.num]; +} +-(void)initSubviews{ + self.backgroundColor =RGB16(0xffffff); + self.giftImageView = [[UIImageView alloc] init]; + self.giftImageView.contentMode = UIViewContentModeScaleAspectFit; + [self addSubview:self.giftImageView]; + [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(80); + make.centerX.equalTo(self); + make.top.mas_equalTo(40); + }]; + + self.giftNameLabel = [[UILabel alloc] init]; + self.giftNameLabel.font = [UIFont systemFontOfSize:14.f]; + self.giftNameLabel.textColor = QXConfig.themeColor; + [self addSubview:self.giftNameLabel]; + [self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self); + make.top.equalTo(self.giftImageView.mas_bottom).offset(20); + }]; + + self.happyBtn = [[UIButton alloc] init]; + [self.happyBtn setBackgroundImage:[UIImage imageNamed:@"sign_app_btn_bg"] forState:(UIControlStateNormal)]; + [self.happyBtn setTitle:@"开心收下" forState:(UIControlStateNormal)]; + [self.happyBtn addTarget:self action:@selector(happyAction) forControlEvents:(UIControlEventTouchUpInside)]; + self.happyBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14]; + [self.happyBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)]; + [self.happyBtn addRoundedCornersWithRadius:25]; + [self addSubview:self.happyBtn]; + [self.happyBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(ScaleWidth(257)); + make.height.mas_equalTo(50); + make.centerX.equalTo(self); + make.bottom.equalTo(self); + }]; +} + +-(void)happyAction{ + if (self.happyBlock) { + self.happyBlock(); + } +} +@end diff --git a/QXLive/Other/AppDelegate.m b/QXLive/Other/AppDelegate.m index 0b2989c..b939c69 100644 --- a/QXLive/Other/AppDelegate.m +++ b/QXLive/Other/AppDelegate.m @@ -289,6 +289,10 @@ } } -(void)popInviteWithModel:(QXRoomListModel*)model{ + QXRoomNavigationController*na = (QXRoomNavigationController*)KEYWINDOW.rootViewController; + if ([na.visibleViewController isKindOfClass:[QXAlertViewController class]]) { + return; + } __block QXRoomListModel *roomModel = model; QXInvitePopView *view = [[QXInvitePopView alloc] init]; view.model = model; diff --git a/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/Contents.json new file mode 100644 index 0000000..02b8c96 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "app_sign_drawed@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "app_sign_drawed@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/app_sign_drawed@2x.png b/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/app_sign_drawed@2x.png new file mode 100644 index 0000000..136e0c3 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/app_sign_drawed@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/app_sign_drawed@3x.png b/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/app_sign_drawed@3x.png new file mode 100644 index 0000000..a329fc4 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/app_sign_drawed.imageset/app_sign_drawed@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/app_sign_task_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/app_sign_task_bg.imageset/Contents.json new file mode 100644 index 0000000..872f4ec --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/app_sign_task_bg.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "app_sign_task_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/app_sign_task_bg.imageset/app_sign_task_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/app_sign_task_bg.imageset/app_sign_task_bg@2x.png new file mode 100644 index 0000000..680f1f2 Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/app_sign_task_bg.imageset/app_sign_task_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/Contents.json b/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/Contents.json new file mode 100644 index 0000000..c194988 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "sign_app_btn_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "sign_app_btn_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/sign_app_btn_bg@2x.png b/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/sign_app_btn_bg@2x.png new file mode 100644 index 0000000..86e004c Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/sign_app_btn_bg@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/sign_app_btn_bg@3x.png b/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/sign_app_btn_bg@3x.png new file mode 100644 index 0000000..8dcc2db Binary files /dev/null and b/QXLive/Other/Assets.xcassets/mine/sign_app_btn_bg.imageset/sign_app_btn_bg@3x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/Contents.json b/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/Contents.json new file mode 100644 index 0000000..c356fa3 --- /dev/null +++ b/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_gift_teacher_boom_tag_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_gift_teacher_boom_tag_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/room_gift_teacher_boom_tag_icon@2x.png b/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/room_gift_teacher_boom_tag_icon@2x.png new file mode 100644 index 0000000..cd63e1a Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/room_gift_teacher_boom_tag_icon@2x.png differ diff --git a/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/room_gift_teacher_boom_tag_icon@3x.png b/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/room_gift_teacher_boom_tag_icon@3x.png new file mode 100644 index 0000000..911243f Binary files /dev/null and b/QXLive/Other/Assets.xcassets/room/room_gift_teacher_boom_tag_icon.imageset/room_gift_teacher_boom_tag_icon@3x.png differ diff --git a/QXLive/Other/QXApi.h b/QXLive/Other/QXApi.h index 5d514ca..89ceec8 100644 --- a/QXLive/Other/QXApi.h +++ b/QXLive/Other/QXApi.h @@ -411,15 +411,15 @@ static NSString * QXBagOutcomeList = @"api/UserGiftPack/get_gift_pack_outcome"; /// 每日任务列表 -static NSString * QXDayTaskList = @"api/Dailytasks/dailyTasksList"; +static NSString * QXDayTaskList = @"api/Tasks/dailyTasksList"; /// 开启礼盒 -static NSString * QXDayTaskOpenGift = @"api/Dailytasks/dailyTasksOpenBox"; +static NSString * QXDayTaskOpenGift = @"api/Tasks/dailyTasksOpenBox"; /// 完成每日任务 -static NSString * QXDayTaskFinished = @"api/Dailytasks/dailyTasksComplete"; +static NSString * QXDayTaskFinished = @"api/Tasks/dailyTasksComplete"; /// 领取每日任务金币奖励 -static NSString * QXDayDrawTaskCoin = @"api/Dailytasks/dailyTasksReceive"; +static NSString * QXDayDrawTaskCoin = @"api/Tasks/dailyTasksReceive"; /// 礼盒记录 -static NSString * QXDayGiftBoxRecord = @"api/Dailytasks/dailyTasksBoxRecord"; +static NSString * QXDayGiftBoxRecord = @"api/Tasks/dailyTasksBoxRecord"; /// 置顶关系 static NSString * QXTopRelationCard = @"api/Room/top_relation_card"; /// 删除关系 @@ -552,5 +552,13 @@ static NSString * QXSignDelaySign = @"api/Sign/sign_delay"; /// 心跳 static NSString * QXKeepAlive = @"api/Xintiao/keep_room_heartbeat"; +/// 师徒任务 +static NSString * QXRoomTaskJumpRoom = @"api/Room/task_jump_room"; +/// 每日签到状态 +static NSString * QXAppSignTask = @"api/Tasks/dailyTasksSignList"; +/// 每日签到 +static NSString * QXAppSign = @"api/Tasks/dailyTasksSign"; +/// 每日签到 +static NSString * QXAppSignStatus = @"api/Tasks/dailyTasksSignStatus"; #endif /* Api_h */ diff --git a/QXLive/Room(房间)/View/QXRoomTitleView.m b/QXLive/Room(房间)/View/QXRoomTitleView.m index 0598229..1ec1e6b 100644 --- a/QXLive/Room(房间)/View/QXRoomTitleView.m +++ b/QXLive/Room(房间)/View/QXRoomTitleView.m @@ -151,7 +151,8 @@ }]; [self addSubview:self.onLineBgView]; [self.onLineBgView mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.equalTo(self.countLabel.mas_left).offset(-5); +// make.right.equalTo(self.countLabel.mas_left).offset(-5); + make.right.equalTo(self.closeBtn.mas_left).offset(-5); make.left.equalTo(self.leftBgView.mas_right); make.height.equalTo(self.leftBgView); make.top.equalTo(self.leftBgView); diff --git a/QXLive/Room(房间)/View/点唱/QXSingerSongListSubView.m b/QXLive/Room(房间)/View/点唱/QXSingerSongListSubView.m index 4508ed1..a810624 100644 --- a/QXLive/Room(房间)/View/点唱/QXSingerSongListSubView.m +++ b/QXLive/Room(房间)/View/点唱/QXSingerSongListSubView.m @@ -73,7 +73,7 @@ self.todayTitle = @"今日"; self.yestoryTitle = @"昨日"; self.weekTitle = @"本周"; - self.lastweekTitle = @"上周"; + self.lastweekTitle = @"本月"; [self.titles removeAllObjects]; [self.titles addObject:self.todayTitle]; [self.titles addObject:self.yestoryTitle]; diff --git a/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.m b/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.m index 320709c..c542e57 100644 --- a/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.m +++ b/QXLive/Room(房间)/View/用户信息/QXUserCpDressView.m @@ -238,6 +238,10 @@ [self stopHWDMP4]; _model = nil; } +-(void)dealloc{ + [self.mp4View stopHWDMP4]; + self.mp4View = nil; +} //- (QXEffectSvgaView *)svgaView { // if (!_svgaView) { // _svgaView = [[QXEffectSvgaView alloc] initWithFrame:CGRectZero isAutoPlay:YES]; diff --git a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m index be76e06..85feb44 100644 --- a/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m +++ b/QXLive/Room(房间)/View/麦位视图/QXRoomSeatTypeSignView.m @@ -507,10 +507,13 @@ showToast(@"签约座位暂无人员"); return; } + self.startBtn.userInteractionEnabled = NO; + MJWeakSelf [QXMineNetwork signStartWithRoomId:self.roomModel.room_info.room_id userId:self.signView.pitModel.user_id successBlock:^(NSDictionary * _Nonnull dict) { - + weakSelf.startBtn.userInteractionEnabled = YES; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { showToast(msg); + weakSelf.startBtn.userInteractionEnabled = YES; }]; } -(void)delayAction{ @@ -543,7 +546,7 @@ }]; } -(void)applyAction{ - [QXMineNetwork roomUpSeatWithRoomId:self.roomModel.room_info.room_id pit_number:@"1" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) { + [QXMineNetwork roomUpSeatWithRoomId:self.roomModel.room_info.room_id pit_number:@"" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) { } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { showToast(msg); diff --git a/QXLive/Tabbar/弹窗/QXCustomAlertView.h b/QXLive/Tabbar/弹窗/QXCustomAlertView.h index bba5d47..d0fbee1 100644 --- a/QXLive/Tabbar/弹窗/QXCustomAlertView.h +++ b/QXLive/Tabbar/弹窗/QXCustomAlertView.h @@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong)NSString*message; @property (nonatomic,strong)NSString*cancleTitle; @property (nonatomic,strong)NSString*commitTitle; +@property (nonatomic,assign)NSInteger autoDismissTime; @property (nonatomic,assign)BOOL isFromController; @property (nonatomic,copy)void(^commitBlock)(void); @property (nonatomic,copy)void(^cancelBlock)(void); diff --git a/QXLive/Tabbar/弹窗/QXCustomAlertView.m b/QXLive/Tabbar/弹窗/QXCustomAlertView.m index f08f9a4..7edb69c 100644 --- a/QXLive/Tabbar/弹窗/QXCustomAlertView.m +++ b/QXLive/Tabbar/弹窗/QXCustomAlertView.m @@ -12,6 +12,7 @@ @property (nonatomic,strong)UILabel *messageLabel; @property (nonatomic,strong)UIButton *cancelBtn; @property (nonatomic,strong)UIButton *commitBtn; +@property (nonatomic,strong)QXTimer *timer; @end @implementation QXCustomAlertView @@ -119,7 +120,28 @@ [self.commitBtn setTitle:commitTitle forState:(UIControlStateNormal)]; } +-(void)setAutoDismissTime:(NSInteger)autoDismissTime{ + if (autoDismissTime > 0) { + @weakify(self); + __block NSInteger timeCount = autoDismissTime; + self.timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{ + @strongify(self); + timeCount--; + if (timeCount<=0) { + [self.timer invalidate]; + [self cancelAction]; + }else{ + [self.cancelBtn setTitle:[NSString stringWithFormat:@"%@(%ld)",self.cancleTitle,timeCount] forState:(UIControlStateNormal)]; + } + }]; + } +} + -(void)cancelAction{ + if (self.timer) { + [self.timer invalidate]; + self.timer = nil; + } if (self.isFromController) { if (self.cancelBlock) { self.cancelBlock(); @@ -132,6 +154,10 @@ [self hide]; } -(void)commitAction{ + if (self.timer) { + [self.timer invalidate]; + self.timer = nil; + } if (self.isFromController) { if (self.commitBlock) { self.commitBlock(); @@ -152,9 +178,11 @@ self.messageLabel.text = message; } if (cancleTitle) { + _cancleTitle = cancleTitle; [self.cancelBtn setTitle:cancleTitle forState:(UIControlStateNormal)]; } if (commitTitle) { + _commitTitle = commitTitle; [self.commitBtn setTitle:commitTitle forState:(UIControlStateNormal)]; } CGFloat messageHeight = [message heightForFont:[UIFont systemFontOfSize:13] width:ScaleWidth(275)-1]; diff --git a/QXLive/Tabbar/弹窗/QXGiftCell.m b/QXLive/Tabbar/弹窗/QXGiftCell.m index 97d21ad..4440a30 100644 --- a/QXLive/Tabbar/弹窗/QXGiftCell.m +++ b/QXLive/Tabbar/弹窗/QXGiftCell.m @@ -121,6 +121,10 @@ } if ([roomGiftModel.is_cp isEqualToString:@"1"]) { self.cpImageView.hidden = NO; + self.cpImageView.image = [UIImage imageNamed:@"room_gift_heart_boom_tag_icon"]; + }else if ([roomGiftModel.is_teacher isEqualToString:@"1"]) { + self.cpImageView.image = [UIImage imageNamed:@"room_gift_teacher_boom_tag_icon"]; + self.cpImageView.hidden = NO; }else{ self.cpImageView.hidden = YES; }