修改在线列表
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#import "QXHomeTopView.h"
|
||||
#import "QXSystemNoticeViewController.h"
|
||||
#import "QXHotRoomViewController.h"
|
||||
#import "QXInvitePopView.h"
|
||||
|
||||
@interface QXHomeViewController ()<JXPagerViewDelegate,JXCategoryViewDelegate,GKCycleScrollViewDataSource,GKCycleScrollViewDelegate,QXGiftScrollViewDelegate,SDCycleScrollViewDelegate,QXHomeTopViewDelegate>
|
||||
@property (nonatomic, strong) JXPagerView *pagingView;
|
||||
@@ -58,6 +59,7 @@
|
||||
@property (nonatomic,strong)NSMutableArray *rechargePermissionArray;
|
||||
|
||||
@property (nonatomic,strong)QXRechargePermissionModel *permissionModel;
|
||||
@property (nonatomic,strong)QXRoomListModel *recommendRoom;
|
||||
@end
|
||||
|
||||
@implementation QXHomeViewController
|
||||
@@ -147,6 +149,7 @@
|
||||
self.rechargePermissionView.backgroundColor = [UIColor clearColor];
|
||||
self.rechargePermissionView.hidden = YES;
|
||||
[self.view addSubview:self.rechargePermissionView];
|
||||
[self getRecommendRoom];
|
||||
}
|
||||
- (void)viewDidLayoutSubviews {
|
||||
[super viewDidLayoutSubviews];
|
||||
@@ -168,17 +171,30 @@
|
||||
[self.titles removeAllObjects];
|
||||
NSMutableArray *arr = [NSMutableArray array];
|
||||
[self.titles addObjectsFromArray:list];
|
||||
for (QXMyRoomType *md in list) {
|
||||
NSInteger default_index = 0;
|
||||
for (int i = 0 ; i < list.count; i++) {
|
||||
QXMyRoomType *md = list[i];
|
||||
[arr addObject:md.label_name];
|
||||
if (md.default_index.intValue == 1) {
|
||||
default_index = i;
|
||||
}
|
||||
}
|
||||
self.categoryView.titles = arr;
|
||||
self.categoryView.defaultSelectedIndex = default_index;
|
||||
[self.categoryView reloadData];
|
||||
[self.pagingView.mainTableView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[self.pagingView.mainTableView.mj_header endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)getRecommendRoom{
|
||||
MJWeakSelf
|
||||
[QXHomePageNetwork getRecommendRoomSuccessBlock:^(QXRoomListModel * _Nonnull model) {
|
||||
weakSelf.recommendRoom = model;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
//-(void)getFirstRechargePermission{
|
||||
// @weakify(self)
|
||||
// [QXHomePageNetwork getFirstRechargePermissionSuccessBlock:^(BOOL isShow) {
|
||||
@@ -303,6 +319,7 @@
|
||||
return;
|
||||
}
|
||||
if (self.permissionModel.first_charge_permission.intValue != 1) {
|
||||
[self popRecommendRoom];
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
@@ -310,7 +327,7 @@
|
||||
view.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
[weakSelf popRecommendRoom];
|
||||
}];
|
||||
};
|
||||
view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
|
||||
@@ -338,6 +355,25 @@
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)popRecommendRoom{
|
||||
if (self.recommendRoom) {
|
||||
QXInvitePopView *view = [[QXInvitePopView alloc] init];
|
||||
view.model = self.recommendRoom;
|
||||
view.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
view.agreeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.recommendRoom.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
};
|
||||
|
||||
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
#pragma mark - JXPagingViewDelegate
|
||||
|
||||
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
||||
@@ -590,12 +626,14 @@
|
||||
_categoryView.titleFont = [UIFont boldSystemFontOfSize:16];
|
||||
_categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:20];
|
||||
_categoryView.averageCellSpacingEnabled = NO;
|
||||
JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init];
|
||||
JXCategoryIndicatorLineView *indicatorView = [[JXCategoryIndicatorLineView alloc] init];
|
||||
indicatorView.indicatorWidth = JXCategoryViewAutomaticDimension;
|
||||
indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
||||
indicatorView.indicatorImageViewSize = CGSizeMake(50, 28);
|
||||
self.indicatorView = indicatorView;
|
||||
indicatorView.verticalMargin = 5;
|
||||
// indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
||||
// indicatorView.indicatorImageViewSize = CGSizeMake(50, 28);
|
||||
// self.indicatorView = indicatorView;
|
||||
// indicatorView.verticalMargin = 5;
|
||||
indicatorView.indicatorColor = QXConfig.themeColor;
|
||||
// indicatorView.indicatorColor = [UIColor colorWithHexString:@"#FFFFFF"];
|
||||
_categoryView.indicators = @[indicatorView];
|
||||
}
|
||||
return _categoryView;
|
||||
|
||||
@@ -96,6 +96,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
+(void)getNewUserGiftListSuccessBlock:(void (^)(NSArray<QXNiceGiftRechargeModel*> * list))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
/**
|
||||
获取推荐房间
|
||||
*/
|
||||
+(void)getRecommendRoomSuccessBlock:(void (^)(QXRoomListModel * model))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -165,6 +165,21 @@
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
|
||||
/**
|
||||
获取推荐房间
|
||||
*/
|
||||
+(void)getRecommendRoomSuccessBlock:(void (^)(QXRoomListModel * model))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
|
||||
[[QXRequset shareInstance] getWithUrl:QXRecommendRoom parameters:@{} needCache:NO success:^(id responseObject) {
|
||||
if (successBlock) {
|
||||
QXRoomListModel *model = [QXRoomListModel yy_modelWithJSON:responseObject[@"data"]];
|
||||
successBlock(model);
|
||||
}
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
/// 首充好礼礼物列表
|
||||
//static NSString * QXAppFirstRechargeGiftList = @"api/Activities/first_charge_gift";
|
||||
/// 首充好礼弹框权限
|
||||
|
||||
@@ -158,6 +158,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
QXRoomMessageTypeDelaySignTime = 1093,
|
||||
/// 身价发生变化
|
||||
QXRoomMessageTypeSignBodyPriceDidChanged = 1091,
|
||||
|
||||
/// 签约麦邀请
|
||||
QXRoomMessageTypeInviteSignUpSeat = 1094,
|
||||
}QXRoomMessageType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXRoomMessageManagerDelegate <NSObject>
|
||||
@@ -312,6 +315,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId sign_coin_list:(NSArray*)sign_coin_list;
|
||||
/// 签约身价变化
|
||||
-(void)signTimeDelayWithEndTime:(NSString*)endTime;
|
||||
/// 主持邀请上签约麦
|
||||
-(void)signSeatInviteWithUserId:(NSString*)userId content:(NSString*)content;
|
||||
|
||||
@end
|
||||
@interface QXRoomMessageManager : NSObject
|
||||
|
||||
@@ -723,7 +723,14 @@
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case QXRoomMessageTypeInviteSignUpSeat:{
|
||||
NSString *user_id = [NSString stringWithFormat:@"%@",msg.Text[@"user_id"]];
|
||||
NSString *text = [NSString stringWithFormat:@"%@",msg.Text[@"text"]];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(signSeatInviteWithUserId:content:)]) {
|
||||
[self.delegate signSeatInviteWithUserId:user_id content:text];
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,8 @@
|
||||
return cell;
|
||||
}else{
|
||||
QXMessageListModel *model = self.dataArray[indexPath.row];
|
||||
if (model.type.intValue == 6) {
|
||||
if (model.type.intValue == 6 || model.type.intValue == 7) {
|
||||
/// 公会邀请 和
|
||||
QXSystemMessageHandleCell *cell = [QXSystemMessageHandleCell cellWithTableView:tableView];
|
||||
cell.model = model;
|
||||
cell.delegate = self;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
//@property (nonatomic,strong)UIButton *settingBtn;
|
||||
@property (nonatomic,strong)QXUserModel *userModel;
|
||||
@property (nonatomic,strong)NSMutableArray *bannerArry;
|
||||
@property (nonatomic,strong)NSString *cancelCode;
|
||||
@end
|
||||
|
||||
@implementation QXMineViewController
|
||||
@@ -357,7 +358,8 @@
|
||||
QXSettingViewController *vc = [[QXSettingViewController alloc] init];
|
||||
vc.haveNobility = self.userModel.is_hide.intValue == 1;
|
||||
MJWeakSelf
|
||||
vc.logOutBlock = ^(BOOL isCancel) {
|
||||
vc.logOutBlock = ^(BOOL isCancel, NSString * _Nonnull code) {
|
||||
weakSelf.cancelCode = code;
|
||||
if (isCancel) {
|
||||
[weakSelf performSelector:@selector(cancelAccount) afterDelay:0.5];
|
||||
}else{
|
||||
@@ -398,11 +400,11 @@
|
||||
}
|
||||
|
||||
-(void)cancelAccount{
|
||||
[QXMineNetwork cancelAccountSuccessBlock:^(NSDictionary * _Nonnull dict) {
|
||||
// [QXMineNetwork cancelAccountWithCode:self.cancelCode successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
// showToast(msg);
|
||||
// }];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXSettingViewController : QXBaseViewController
|
||||
@property (nonatomic,copy)void(^logOutBlock)(BOOL isCancel);
|
||||
@property (nonatomic,copy)void(^logOutBlock)(BOOL isCancel,NSString*code);
|
||||
@property (nonatomic,assign)BOOL haveNobility;
|
||||
@end
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#import "QXSettingCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXAlertView.h"
|
||||
#import "QXReVerificationPopView.h"
|
||||
#import "QXTimer.h"
|
||||
static NSInteger maxClickCount = 6;
|
||||
@interface QXSettingViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@@ -17,6 +18,7 @@ static NSInteger maxClickCount = 6;
|
||||
@property (nonatomic,strong)NSDictionary *valueDict;
|
||||
@property (nonatomic,strong)NSDictionary *controllerDict;
|
||||
@property (nonatomic,strong)QXAlertView *alertView;
|
||||
@property (nonatomic,strong)QXReVerificationPopView *codeAlertView;
|
||||
@property (nonatomic,strong)QXTimer *timer;
|
||||
@property (nonatomic,assign)NSInteger clickCount;
|
||||
@end
|
||||
@@ -174,14 +176,22 @@ static NSInteger maxClickCount = 6;
|
||||
}
|
||||
|
||||
if ([text isEqualToString:QXText(@"账号注销")]) {
|
||||
[[QXGlobal shareGlobal] showView:self.alertView controller:self popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
UIView *view;
|
||||
if ([QXGlobal.shareGlobal.loginModel.mobile isExist]) {
|
||||
[[QXGlobal shareGlobal] showView:self.codeAlertView controller:self popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}else{
|
||||
[[QXGlobal shareGlobal] showView:self.alertView controller:self popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
if ([text isEqualToString:QXText(@"退出登录")]) {
|
||||
if (self.logOutBlock) {
|
||||
self.logOutBlock(NO);
|
||||
self.logOutBlock(NO,@"");
|
||||
}
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
return;
|
||||
@@ -214,14 +224,40 @@ static NSInteger maxClickCount = 6;
|
||||
_alertView.message = @"注销后您当前的账户金币及钻石将无法找回\n30天内本账号将无法登录,请谨慎操作!";
|
||||
MJWeakSelf
|
||||
_alertView.commitBlock = ^{
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
if (weakSelf.logOutBlock) {
|
||||
weakSelf.logOutBlock(YES);
|
||||
}
|
||||
[weakSelf cancelAccountWithCode:@""];
|
||||
};
|
||||
}
|
||||
return _alertView;
|
||||
}
|
||||
-(void)cancelAccountWithCode:(NSString*)code{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork cancelAccountWithCode:code successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
if (weakSelf.logOutBlock) {
|
||||
weakSelf.logOutBlock(YES,code);
|
||||
}
|
||||
}];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
- (QXReVerificationPopView *)codeAlertView{
|
||||
if (!_codeAlertView) {
|
||||
_codeAlertView = [[QXReVerificationPopView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(240))];
|
||||
_codeAlertView.isCancelAccount = YES;
|
||||
MJWeakSelf
|
||||
_codeAlertView.commitBlock = ^(NSString * _Nonnull code) {
|
||||
if (code.length == 0) {
|
||||
showToast(@"请输入验证码");
|
||||
return;
|
||||
}
|
||||
[weakSelf cancelAccountWithCode:code];
|
||||
};
|
||||
}
|
||||
return _codeAlertView;
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
@@ -105,5 +105,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)NSString*id;
|
||||
/// 房间密码
|
||||
@property (nonatomic,strong)NSString*label_name;
|
||||
/// 默认选中 1 选中 0 未选中
|
||||
@property (nonatomic,strong)NSString*default_index;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -170,8 +170,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
账号注销
|
||||
*/
|
||||
+(void)cancelAccountSuccessBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
+(void)cancelAccountWithCode:(NSString*)cancelCode
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
/**
|
||||
获得钱包余额
|
||||
@@ -357,7 +358,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
+(void)roomOnlineListWithRoomId:(NSString*)room_id
|
||||
page:(NSInteger)page
|
||||
successBlock:(void(^)(NSArray<QXRoomUserInfoModel *>*onPitList,NSArray<QXRoomUserInfoModel *>*offPitList))successBlock
|
||||
successBlock:(void(^)(NSArray<QXRoomUserInfoModel *>*onPitList,NSArray<QXRoomUserInfoModel *>*offPitList,NSString*count))successBlock
|
||||
failBlock:(void(^)(NSError* error,NSString*msg))failBlock;
|
||||
|
||||
|
||||
@@ -1395,6 +1396,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
+(void)appKeepAliveWithRoomId:(NSString*)room_id;
|
||||
|
||||
/**
|
||||
签约房间主持邀请上签约麦用户拒绝
|
||||
*/
|
||||
+(void)signRoomRefuseSignWithRoomId:(NSString*)roomId
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -349,9 +349,10 @@
|
||||
/**
|
||||
账号注销
|
||||
*/
|
||||
+(void)cancelAccountSuccessBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
|
||||
[[QXRequset shareInstance] getWithUrl:QXAccountCancel parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@""} needCache:NO success:^(id responseObject) {
|
||||
+(void)cancelAccountWithCode:(NSString *)cancelCode
|
||||
successBlock:(void (^)(NSDictionary * _Nonnull))successBlock
|
||||
failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
[[QXRequset shareInstance] getWithUrl:QXAccountCancel parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@"",@"sms_code":cancelCode?:@""} needCache:NO success:^(id responseObject) {
|
||||
if (successBlock) {
|
||||
successBlock(responseObject[@"data"]);
|
||||
}
|
||||
@@ -748,7 +749,7 @@
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
+(void)roomOnlineListWithRoomId:(NSString *)room_id page:(NSInteger)page successBlock:(nonnull void (^)(NSArray<QXRoomUserInfoModel *> * _Nonnull, NSArray<QXRoomUserInfoModel *> * _Nonnull))successBlock failBlock:(nonnull void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
+(void)roomOnlineListWithRoomId:(NSString *)room_id page:(NSInteger)page successBlock:(nonnull void (^)(NSArray<QXRoomUserInfoModel *> * _Nonnull, NSArray<QXRoomUserInfoModel *> * _Nonnull, NSString * _Nonnull))successBlock failBlock:(nonnull void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
NSDictionary *parameters =@{
|
||||
@"room_id":room_id?room_id:@"",
|
||||
@"page":[NSNumber numberWithInteger:page]
|
||||
@@ -757,7 +758,8 @@
|
||||
if (successBlock) {
|
||||
NSArray *onPitlist = [NSArray yy_modelArrayWithClass:[QXRoomUserInfoModel class] json:responseObject[@"data"][@"on_pit"]];
|
||||
NSArray *offPitlist = [NSArray yy_modelArrayWithClass:[QXRoomUserInfoModel class] json:responseObject[@"data"][@"off_pit"]];
|
||||
successBlock(onPitlist,offPitlist);
|
||||
NSString *count = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"count"]];
|
||||
successBlock(onPitlist,offPitlist,count);
|
||||
}
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
failBlock(error,msg);
|
||||
@@ -2807,4 +2809,21 @@
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
+(void)signRoomRefuseSignWithRoomId:(NSString*)roomId
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
|
||||
NSDictionary *parameters =@{
|
||||
@"room_id":roomId?:@"",
|
||||
};
|
||||
[[QXRequset shareInstance] postWithUrl:QXRefuseSign parameters:parameters needCache:NO success:^(id responseObject) {
|
||||
if (successBlock) {
|
||||
successBlock(responseObject[@"data"]);
|
||||
}
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXReVerificationPopView : UIView
|
||||
@property (nonatomic,copy)void(^commitBlock)(NSString*code);
|
||||
/// 是否为注销账号
|
||||
@property (nonatomic,assign)BOOL isCancelAccount;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#import "QXLoginNetwork.h"
|
||||
@interface QXReVerificationPopView()<QXLoginTextFieldDelegate>
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UILabel *messageLabel;
|
||||
@property (nonatomic,strong)QXLoginTextField *codeTextField;
|
||||
@property (nonatomic,strong)UIButton *closeBtn;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@@ -41,6 +42,15 @@
|
||||
self.titleLabel.text = QXText(@"二次验证");
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
|
||||
self.messageLabel = [[UILabel alloc] init];
|
||||
self.messageLabel.font = [UIFont systemFontOfSize:13];
|
||||
self.messageLabel.textColor = QXConfig.textColor;
|
||||
self.messageLabel.text = QXText(@"注销后您当前的账户金币及钻石将无法找回\n30天内本账号将无法登录,请谨慎操作!");
|
||||
self.messageLabel.hidden = YES;
|
||||
self.messageLabel.numberOfLines = 0;
|
||||
[self addSubview:self.messageLabel];
|
||||
|
||||
self.codeTextField = [[QXLoginTextField alloc] init];
|
||||
self.codeTextField.delegate = self;
|
||||
self.codeTextField.type = LoginTextTypeCode;
|
||||
@@ -74,6 +84,12 @@
|
||||
make.height.mas_equalTo(24);
|
||||
}];
|
||||
|
||||
[self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.titleLabel.mas_bottom).offset(15);
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.mas_equalTo(-16);
|
||||
}];
|
||||
|
||||
[self.codeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(10);
|
||||
make.right.mas_equalTo(-10);
|
||||
@@ -96,6 +112,18 @@
|
||||
self.commitBlock(self.codeTextField.textField.text);
|
||||
}
|
||||
}
|
||||
-(void)setIsCancelAccount:(BOOL)isCancelAccount{
|
||||
_isCancelAccount = isCancelAccount;
|
||||
if (isCancelAccount) {
|
||||
self.titleLabel.text = QXText(@"您正在注销账号");
|
||||
self.messageLabel.hidden = NO;
|
||||
}else{
|
||||
self.titleLabel.text = QXText(@"二次验证");
|
||||
self.messageLabel.hidden = YES;
|
||||
}
|
||||
|
||||
// _alertView.message = @"注销后您当前的账户金币及钻石将无法找回\n30天内本账号将无法登录,请谨慎操作!";
|
||||
}
|
||||
|
||||
-(void)didClickSendCode:(UIButton *)sender{
|
||||
NSString*mobile = [QXGlobal shareGlobal].loginModel.mobile;
|
||||
@@ -103,8 +131,12 @@
|
||||
showToast(@"请先绑定手机号");
|
||||
return;
|
||||
}
|
||||
GetSmscodeType type = GetSmscodeTypeWithDraw;
|
||||
if (self.isCancelAccount) {
|
||||
type = GetSmscodeTypeAccountCancel;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getSmscodeWithMobile:[QXGlobal shareGlobal].loginModel.mobile type:GetSmscodeTypeWithDraw successBlock:^(id _Nonnull responseObject) {
|
||||
[QXLoginNetwork getSmscodeWithMobile:[QXGlobal shareGlobal].loginModel.mobile type:type successBlock:^(id _Nonnull responseObject) {
|
||||
[weakSelf.codeTextField startTimeDown];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
|
||||
@@ -53,7 +53,9 @@
|
||||
#import "IQKeyboardManager.h"
|
||||
#import "QXChirldViewController.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXHomePageNetwork.h"
|
||||
#import "QXRoomNavigationController.h"
|
||||
#import "QXInvitePopView.h"
|
||||
#if DEBUG
|
||||
#import <LLDebugTool.h>
|
||||
#endif
|
||||
@@ -268,13 +270,42 @@
|
||||
QXLOG(@"========app即将进入后台========");
|
||||
}
|
||||
-(void)applicationWillEnterForeground:(UIApplication *)application{
|
||||
QXLOG(@"========app从后台回到前台========");
|
||||
if ([QXGlobal.shareGlobal.roomId isExist]) {
|
||||
[[QXGiftPlayerManager shareManager] startPlay];
|
||||
[[QXGiftDisplayManager sharedManager] becomeFront];
|
||||
[[QXGlobal shareGlobal] dirfViewBecomeToFront];
|
||||
}else{
|
||||
[self getRecommendRoom];
|
||||
}
|
||||
}
|
||||
-(void)getRecommendRoom{
|
||||
if (QXGlobal.shareGlobal.isLogin) {
|
||||
[QXHomePageNetwork getRecommendRoomSuccessBlock:^(QXRoomListModel * _Nonnull model) {
|
||||
[self popInviteWithModel:model];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
-(void)popInviteWithModel:(QXRoomListModel*)model{
|
||||
__block QXRoomListModel *roomModel = model;
|
||||
QXInvitePopView *view = [[QXInvitePopView alloc] init];
|
||||
view.model = model;
|
||||
view.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
view.agreeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:roomModel.room_id isRejoin:NO navagationController:(UINavigationController*)KEYWINDOW.rootViewController];
|
||||
};
|
||||
|
||||
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
/// 设备转向
|
||||
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
|
||||
// ZFInterfaceOrientationMask orientationMask = [ZFLandscapeRotationManager supportedInterfaceOrientationsForWindow:window];
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "Group 7206@2x.png",
|
||||
"filename" : "a_pop_invite@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 57 KiB |
BIN
QXLive/Other/Assets.xcassets/弹窗/a_pop_invite.imageset/a_pop_invite@2x.png
vendored
Normal file
BIN
QXLive/Other/Assets.xcassets/弹窗/a_pop_invite.imageset/a_pop_invite@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 134 KiB |
@@ -34,6 +34,10 @@ static NSString * QXAppVersion = @"api/Version/get_app_version";
|
||||
static NSString * QXAppProtocol = @"api/Page/page_show";
|
||||
/// 获取主题配置
|
||||
static NSString * QXAppTheme = @"api/Theme/get_theme_data";
|
||||
/// 获取推荐房间
|
||||
static NSString * QXRecommendRoom = @"api/Index/index_recommend_room";
|
||||
/// 签约房间主持邀请上签约麦用户拒绝
|
||||
static NSString * QXRefuseSign = @"api/RoomPit/refuse_sign_room_host_invite";
|
||||
|
||||
#pragma mark - 登录
|
||||
/// 验证码登录获取账号列表
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
//
|
||||
|
||||
#import "QXRoomViewController+Sign.h"
|
||||
|
||||
#import "QXAlertView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
@implementation QXRoomViewController (Sign)
|
||||
-(void)resetSignViews{
|
||||
[self.seatContentView setType:QXRoomSeatViewTypeSign];
|
||||
@@ -41,4 +42,33 @@
|
||||
-(void)signTimeDelayWithEndTime:(NSString*)endTime{
|
||||
[self.seatContentView signTimeDelayWithEndTime:endTime];
|
||||
}
|
||||
/// 主持邀请上签约麦
|
||||
-(void)signSeatInviteWithUserId:(NSString*)userId content:(NSString*)content{
|
||||
if ([userId isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
||||
al.type = QXAlertViewTypeSignSeat;
|
||||
al.message = content;
|
||||
al.commitBlock = ^{
|
||||
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:@"1" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
};
|
||||
al.cancelBlock = ^{
|
||||
[self refuseInvite];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)refuseInvite{
|
||||
[QXMineNetwork signRoomRefuseSignWithRoomId:self.roomId successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -293,7 +293,7 @@ QXRoomUserInfoViewDelegate
|
||||
_roomId = roomId;
|
||||
[self.chatListView insertNoitce];
|
||||
MJWeakSelf
|
||||
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList) {
|
||||
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList, NSString * _Nonnull count) {
|
||||
NSMutableArray *arr = [NSMutableArray arrayWithArray:onPitList];
|
||||
[arr addObjectsFromArray:offPitList];
|
||||
weakSelf.titleView.onlineUsers = arr;
|
||||
@@ -362,7 +362,7 @@ QXRoomUserInfoViewDelegate
|
||||
|
||||
}];
|
||||
|
||||
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList) {
|
||||
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList, NSString * _Nonnull count) {
|
||||
NSMutableArray *arr = [NSMutableArray arrayWithArray:onPitList];
|
||||
[arr addObjectsFromArray:offPitList];
|
||||
weakSelf.titleView.onlineUsers = arr;
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,strong)NSMutableArray *onPitListArray;
|
||||
@property (nonatomic,strong)NSMutableArray *offPitListArray;
|
||||
@property (nonatomic,strong)NSMutableArray *allUsers;;
|
||||
@property (nonatomic,assign) NSInteger page;
|
||||
@end
|
||||
|
||||
@implementation QXRoomOnlineUserListView
|
||||
@@ -58,6 +60,11 @@
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
MJWeakSelf
|
||||
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getOnlineList];
|
||||
}];
|
||||
self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getOnlineList];
|
||||
}];
|
||||
[self.bgView addSubview:self.tableView];
|
||||
@@ -84,33 +91,42 @@
|
||||
}
|
||||
-(void)getOnlineList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:0 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.allUsers removeAllObjects];
|
||||
[weakSelf.dataArray addObject:onPitList];
|
||||
[weakSelf.dataArray addObject:offPitList];
|
||||
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:self.page successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList, NSString * _Nonnull count) {
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.onPitListArray removeAllObjects];
|
||||
[weakSelf.offPitListArray removeAllObjects];
|
||||
[weakSelf.allUsers removeAllObjects];
|
||||
}
|
||||
[weakSelf.onPitListArray addObjectsFromArray:onPitList];
|
||||
[weakSelf.offPitListArray addObjectsFromArray:offPitList];
|
||||
[weakSelf.allUsers addObjectsFromArray:onPitList];
|
||||
[weakSelf.allUsers addObjectsFromArray:offPitList];
|
||||
weakSelf.titleLabel.text = [NSString localizedStringWithFormat:QXText(@"用户列表(%@人)"),[NSString stringWithFormat:@"%ld",onPitList.count+offPitList.count]];
|
||||
weakSelf.titleLabel.text = [NSString localizedStringWithFormat:QXText(@"用户列表(%@人)"),[NSString stringWithFormat:@"%@",count]];
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
[weakSelf.tableView reloadData];
|
||||
if (weakSelf.onlineListBlock) {
|
||||
weakSelf.onlineListBlock(weakSelf.allUsers);
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
-(void)setRoomId:(NSString *)roomId{
|
||||
_roomId = roomId;
|
||||
self.page = 1;
|
||||
[self getOnlineList];
|
||||
}
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return self.dataArray.count;
|
||||
return 2;;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
NSMutableArray *arr = self.dataArray[section];
|
||||
return arr.count;
|
||||
if (section == 0) {
|
||||
return self.onPitListArray.count;
|
||||
}else{
|
||||
return self.offPitListArray.count;
|
||||
}
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
@@ -120,13 +136,15 @@
|
||||
}else{
|
||||
cell.cellType = QXBlackListCellTypeOnline;
|
||||
}
|
||||
QXRoomUserInfoModel *model;
|
||||
if (indexPath.section == 0) {
|
||||
cell.isUpSeat = YES;
|
||||
model = self.onPitListArray[indexPath.row];
|
||||
}else{
|
||||
cell.isUpSeat = NO;
|
||||
model = self.offPitListArray[indexPath.row];
|
||||
}
|
||||
NSMutableArray *arr = self.dataArray[indexPath.section];
|
||||
cell.onlineUser = arr[indexPath.row];
|
||||
cell.onlineUser = model;
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
}
|
||||
@@ -150,8 +168,12 @@
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
NSMutableArray *arr = self.dataArray[indexPath.section];
|
||||
QXRoomUserInfoModel*user = arr[indexPath.row];
|
||||
QXRoomUserInfoModel *user;
|
||||
if (indexPath.section == 0) {
|
||||
user = self.onPitListArray[indexPath.row];
|
||||
}else{
|
||||
user = self.offPitListArray[indexPath.row];
|
||||
}
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
|
||||
[self.delegate previewUserInfoWithUserId:user.user_id];
|
||||
}
|
||||
@@ -173,11 +195,24 @@
|
||||
}
|
||||
|
||||
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
//-(NSMutableArray *)dataArray{
|
||||
// if (!_dataArray) {
|
||||
// _dataArray = [NSMutableArray array];
|
||||
// }
|
||||
// return _dataArray;
|
||||
//}
|
||||
-(NSMutableArray *)onPitListArray{
|
||||
if (!_onPitListArray) {
|
||||
_onPitListArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
return _onPitListArray;
|
||||
}
|
||||
|
||||
-(NSMutableArray *)offPitListArray{
|
||||
if (!_offPitListArray) {
|
||||
_offPitListArray = [NSMutableArray array];
|
||||
}
|
||||
return _offPitListArray;
|
||||
}
|
||||
-(NSMutableArray *)allUsers{
|
||||
if (!_allUsers) {
|
||||
|
||||
@@ -18,7 +18,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// pk弹窗
|
||||
QXAlertViewTypeAgreePK,
|
||||
/// 没有取消
|
||||
QXAlertViewTypeNoCancel
|
||||
QXAlertViewTypeNoCancel,
|
||||
/// 签约麦
|
||||
QXAlertViewTypeSignSeat
|
||||
}QXAlertViewType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@@ -126,6 +126,23 @@
|
||||
}];
|
||||
}
|
||||
break;
|
||||
case QXAlertViewTypeSignSeat:{
|
||||
@weakify(self)
|
||||
[self.cancelBtn setTitle:QXText(@"拒绝") forState:(UIControlStateNormal)];
|
||||
[self.commitBtn setTitle:QXText(@"同意") forState:(UIControlStateNormal)];
|
||||
__block int timeCount = 5;
|
||||
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:@"%@(%d)",QXText(@"拒绝"),timeCount] forState:(UIControlStateNormal)];
|
||||
}
|
||||
}];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "QXRoomListModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXInvitePopView : UIView
|
||||
@property (nonatomic,strong)QXRoomListModel *model;
|
||||
@property (nonatomic,copy)void(^closeActionBlock)(void);
|
||||
@property (nonatomic,copy)void(^agreeActionBlock)(void);
|
||||
@end
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
|
||||
@interface QXInvitePopView()
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)QXSeatHeaderView *headerView;
|
||||
@property (nonatomic,strong)UIImageView *headerView;
|
||||
@property (nonatomic,strong)UILabel *inviteLabel;
|
||||
@property (nonatomic,strong)UIButton *agreeBtn;
|
||||
@property (nonatomic,strong)UIButton *commitBtn;
|
||||
@property (nonatomic,strong)UIButton *cancelBtn;
|
||||
@property (nonatomic,strong)QXTimer *timer;
|
||||
@property (nonatomic,strong)UIButton *closeBtn;
|
||||
@end
|
||||
@@ -36,7 +37,11 @@
|
||||
make.height.mas_equalTo(ScaleWidth(200));
|
||||
}];
|
||||
|
||||
self.headerView = [[QXSeatHeaderView alloc] init];
|
||||
self.headerView = [[UIImageView alloc] init];
|
||||
[self.headerView addRoundedCornersWithRadius:35];
|
||||
self.headerView.layer.borderColor = QXConfig.themeColor.CGColor;
|
||||
self.headerView.layer.borderWidth = 2;
|
||||
self.headerView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self addSubview:self.headerView];
|
||||
[self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(70, 70));
|
||||
@@ -56,19 +61,50 @@
|
||||
}];
|
||||
|
||||
|
||||
self.agreeBtn = [[UIButton alloc] init];
|
||||
[self.agreeBtn addRoundedCornersWithRadius:21];
|
||||
self.agreeBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.agreeBtn setTitle:QXText(@"接收邀请") forState:(UIControlStateNormal)];
|
||||
[self.agreeBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
self.agreeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.agreeBtn addTarget:self action:@selector(agreeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.agreeBtn];
|
||||
[self.agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// self.agreeBtn = [[UIButton alloc] init];
|
||||
// [self.agreeBtn addRoundedCornersWithRadius:21];
|
||||
// self.agreeBtn.backgroundColor = RGB16(0x000000);
|
||||
// [self.agreeBtn setTitle:QXText(@"接收邀请") forState:(UIControlStateNormal)];
|
||||
// [self.agreeBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
|
||||
// self.agreeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
// [self.agreeBtn addTarget:self action:@selector(agreeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
// [self addSubview:self.agreeBtn];
|
||||
// [self.agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.bottom.equalTo(self.bgImageView).offset(-12);
|
||||
// make.height.mas_equalTo(42);
|
||||
// make.width.mas_equalTo(178);
|
||||
// make.centerX.equalTo(self.bgImageView);
|
||||
// }];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] init];
|
||||
[self.commitBtn addRoundedCornersWithRadius:21];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.commitBtn setTitle:QXText(@"接受") forState:(UIControlStateNormal)];
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.commitBtn addTarget:self action:@selector(agreeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.commitBtn];
|
||||
[self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(self.bgImageView).offset(-12);
|
||||
make.height.mas_equalTo(42);
|
||||
make.width.mas_equalTo(178);
|
||||
make.centerX.equalTo(self.bgImageView);
|
||||
make.width.mas_equalTo(ScaleWidth(110));
|
||||
make.right.mas_equalTo(-20);
|
||||
}];
|
||||
|
||||
|
||||
self.cancelBtn = [[UIButton alloc] init];
|
||||
[self.cancelBtn addRoundedCornersWithRadius:21];
|
||||
self.cancelBtn.backgroundColor = RGB16(0xF3F3F3);
|
||||
[self.cancelBtn setTitle:QXText(@"拒绝") forState:(UIControlStateNormal)];
|
||||
[self.cancelBtn setTitleColor:RGB16(0x999999) forState:(UIControlStateNormal)];
|
||||
self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.cancelBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.cancelBtn];
|
||||
[self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(self.bgImageView).offset(-12);
|
||||
make.height.mas_equalTo(42);
|
||||
make.width.mas_equalTo(ScaleWidth(110));
|
||||
make.left.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
self.closeBtn = [[UIButton alloc] init];
|
||||
@@ -82,21 +118,31 @@
|
||||
}];
|
||||
|
||||
__block int timeCount = 10;
|
||||
MJWeakSelf
|
||||
__weak typeof(self) weakSelf = self;
|
||||
_timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{
|
||||
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (!strongSelf) {
|
||||
QXLOG(@"⚠️ self has been deallocated, skipping hide operation");
|
||||
return;
|
||||
}
|
||||
timeCount--;
|
||||
if (timeCount<=0) {
|
||||
[weakSelf noAgree];
|
||||
[self->_agreeBtn setTitle:[NSString stringWithFormat:@"%@(0)",QXText(@"接收邀请")] forState:(UIControlStateNormal)];
|
||||
[strongSelf noAgree];
|
||||
[strongSelf.cancelBtn setTitle:[NSString stringWithFormat:@"%@(0)",QXText(@"拒绝")] forState:(UIControlStateNormal)];
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self->_agreeBtn setTitle:[NSString stringWithFormat:@"%@(%d)",QXText(@"接收邀请"),timeCount] forState:(UIControlStateNormal)];
|
||||
[strongSelf.cancelBtn setTitle:[NSString stringWithFormat:@"%@(%d)",QXText(@"拒绝"),timeCount] forState:(UIControlStateNormal)];
|
||||
}];
|
||||
}
|
||||
-(void)noAgree{
|
||||
[self->_timer invalidate];
|
||||
[self.timer invalidate];
|
||||
}
|
||||
|
||||
-(void)setModel:(QXRoomListModel *)model{
|
||||
_model = model;
|
||||
[self.headerView sd_setImageWithURL:[NSURL URLWithString:model.room_cover]];
|
||||
}
|
||||
|
||||
-(void)agreeAction{
|
||||
|
||||
Reference in New Issue
Block a user