修改在线列表
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user