房间完成
@@ -85,13 +85,21 @@ typedef void (^showFinishBlock)(void);
|
||||
avatar:(NSString*)avatar
|
||||
navagationController:(UINavigationController*)navagationController;
|
||||
/**
|
||||
去群聊
|
||||
去公会群聊
|
||||
*/
|
||||
-(void)chatWithGroupId:(NSString*)groupId
|
||||
cover:(NSString*)cover
|
||||
name:(NSString*)name
|
||||
navagationController:(UINavigationController*)navagationController;
|
||||
|
||||
/**
|
||||
去家族群聊
|
||||
*/
|
||||
-(void)chatWithFamilyGroupId:(NSString*)groupId
|
||||
cover:(NSString*)cover
|
||||
name:(NSString*)name
|
||||
navagationController:(UINavigationController*)navagationController;
|
||||
|
||||
/**
|
||||
加入房间
|
||||
*/
|
||||
|
||||
@@ -198,6 +198,20 @@
|
||||
[navagationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)chatWithFamilyGroupId:(NSString *)groupId cover:(NSString *)cover name:(NSString *)name navagationController:(UINavigationController *)navagationController{
|
||||
QXChatViewController *vc = [[QXChatViewController alloc] init];
|
||||
TUIChatConversationModel *data = [[TUIChatConversationModel alloc] init];
|
||||
if ([groupId containsString:@"f"]) {
|
||||
data.groupID = groupId;
|
||||
}else{
|
||||
data.groupID = [NSString stringWithFormat:@"f%@",groupId];
|
||||
}
|
||||
data.faceUrl = cover;
|
||||
data.title = name;
|
||||
vc.data = data;
|
||||
[navagationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)joinRoomWithRoomId:(NSString *)roomId isRejoin:(BOOL)isRejoin navagationController:(UINavigationController *)navagationController{
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
@@ -235,9 +249,7 @@
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (self.roomId && ![self.roomId isEqualToString:roomId]) {
|
||||
[self quitRoomWithRoomId:self.roomId];
|
||||
}
|
||||
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
MJWeakSelf
|
||||
if (isRejoin) {
|
||||
@@ -262,6 +274,8 @@
|
||||
weakSelf.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
[navagationController pushViewController:weakSelf.roomVC animated:YES];
|
||||
weakSelf.roomId = roomId;
|
||||
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
weakSelf.isClickJoinRoom = NO;
|
||||
@@ -279,6 +293,9 @@
|
||||
weakSelf.isClickJoinRoom = YES;
|
||||
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
|
||||
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
||||
if (weakSelf.roomId && ![weakSelf.roomId isEqualToString:roomId]) {
|
||||
[weakSelf quitRoomWithRoomId:weakSelf.roomId];
|
||||
}
|
||||
// hideLoadingInView(KEYWINDOW)
|
||||
// roomModel.room_info.pk_room_id = @"33";
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
@@ -291,6 +308,9 @@
|
||||
weakSelf.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
[navagationController pushViewController:weakSelf.roomVC animated:YES];
|
||||
weakSelf.roomId = roomId;
|
||||
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
|
||||
weakSelf.isClickJoinRoom = NO;
|
||||
[weakSelf showAlertWithMessage:msg roomId:roomId];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
weakSelf.isClickJoinRoom = NO;
|
||||
showToast(msg);
|
||||
@@ -299,6 +319,23 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)showAlertWithMessage:(NSString*)message roomId:(NSString*)roomId{
|
||||
UIAlertController *al = [UIAlertController alertControllerWithTitle:@"温馨提示" message:message preferredStyle:(UIAlertControllerStyleAlert)];
|
||||
if ([roomId isExist] && self.roomId==nil) {
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"再想想" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
|
||||
|
||||
}]];
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"去房间" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
|
||||
[self joinRoomWithRoomId:roomId isRejoin:NO navagationController:KEYWINDOW.rootViewController.navigationController];
|
||||
}]];
|
||||
}else{
|
||||
[al addAction:[UIAlertAction actionWithTitle:@"我知道了" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
|
||||
|
||||
}]];
|
||||
}
|
||||
[KEYWINDOW.rootViewController presentViewController:al animated:YES completion:nil];
|
||||
}
|
||||
|
||||
|
||||
-(void)popToRoomViewController{
|
||||
QXRoomNavigationController *navagationController = (QXRoomNavigationController*)KEYWINDOW.rootViewController;
|
||||
@@ -381,6 +418,6 @@
|
||||
[[QXRedPacketDriftView shareView] dirfViewDidToBackground];
|
||||
}
|
||||
-(void)dirfViewBecomeToFront{
|
||||
|
||||
[[QXDrifNobilityJoinRoomView shareView] dirfViewBecomeToFront];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -309,7 +309,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 签约结束
|
||||
-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value;
|
||||
/// 签约身价变化
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId;
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId sign_coin_list:(NSArray*)sign_coin_list;
|
||||
/// 签约身价变化
|
||||
-(void)signTimeDelayWithEndTime:(NSString*)endTime;
|
||||
|
||||
|
||||
@@ -712,8 +712,13 @@
|
||||
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
|
||||
NSString *sign_id = [NSString stringWithFormat:@"%@",msg.Text[@"sign_id"]];
|
||||
NSString *sign_value = [NSString stringWithFormat:@"%@",msg.Text[@"sign_value"]];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(signValueDidChangedWithSignUserInfo:sign_value:signId:)]) {
|
||||
[self.delegate signValueDidChangedWithSignUserInfo:model.FromUserInfo sign_value:sign_value signId:sign_id];
|
||||
NSArray *sign_coin_list;
|
||||
id object = msg.Text[@"sign_coin_list"];
|
||||
if ([object isKindOfClass:[NSArray class]]) {
|
||||
sign_coin_list = object;
|
||||
}
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(signValueDidChangedWithSignUserInfo:sign_value:signId:sign_coin_list:)]) {
|
||||
[self.delegate signValueDidChangedWithSignUserInfo:model.FromUserInfo sign_value:sign_value signId:sign_id sign_coin_list:sign_coin_list];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
#import "QXFamilyMemberCell.h"
|
||||
#import "QXFamilyTopCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
@interface QXFamilySubViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
#import "QXUserHomePageViewController.h"
|
||||
@interface QXFamilySubViewController ()<UITableViewDelegate,UITableViewDataSource,QXFamilyMemberCellDelegate>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXFamilyModel *model;
|
||||
|
||||
@@ -53,6 +54,11 @@
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)needRefresh{
|
||||
self.page = 1;
|
||||
[self getList];
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
if (self.model) {
|
||||
return 2;
|
||||
@@ -74,6 +80,7 @@
|
||||
}else{
|
||||
QXFamilyMemberCell *cell = [QXFamilyMemberCell cellWithTableView:tableView];
|
||||
cell.model = self.model.group_members_lists[indexPath.row];
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
@@ -120,6 +127,12 @@
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 0;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXFamilyMemberModel*md = self.model.group_members_lists[indexPath.row];
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
vc.user_id = md.user_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
|
||||
@@ -63,6 +63,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic,strong)NSString *yesterday_earnings;
|
||||
/// 是否显示续约按钮 1:显示 0:不显示
|
||||
@property(nonatomic,strong)NSString *is_show_sign;
|
||||
/// 续约身价的百分比
|
||||
@property(nonatomic,strong)NSString *sign_user_ratio;
|
||||
/// 续约时长
|
||||
@property(nonatomic,strong)NSString *sign_times;
|
||||
/// 续约免费时长
|
||||
@property(nonatomic,strong)NSString *free_re_sign_day;
|
||||
@end
|
||||
|
||||
@interface QXFamilyEarningModel : NSObject
|
||||
|
||||
@@ -130,6 +130,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (nonatomic,strong)QXUserCpInfoModel *cp_info;
|
||||
|
||||
@property (nonatomic,strong)QXUserHomeModel *master;
|
||||
|
||||
-(instancetype)copyModel;
|
||||
@end
|
||||
|
||||
@@ -216,6 +218,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (nonatomic,strong)QXUserCpInfoModel *cp_info;
|
||||
|
||||
@property (nonatomic,strong)QXUserHomeModel *master;
|
||||
|
||||
//@property (nonatomic,strong)QXRelationshipListModel *qinmi;
|
||||
//@property (nonatomic,strong)QXRelationshipListModel *zhenai;
|
||||
@end
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
+(NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass{
|
||||
return @{
|
||||
@"tag_list" : @"QXUserTag",
|
||||
@"cp_info": @"QXUserCpInfoModel"
|
||||
@"cp_info": @"QXUserCpInfoModel",
|
||||
@"master": @"QXUserHomeModel",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -61,7 +62,8 @@
|
||||
return @{
|
||||
// @"qinmi" : @"QXRelationshipListModel",
|
||||
// @"zhenai" : @"QXRelationshipListModel"
|
||||
@"cp_info": @"QXUserCpInfoModel"
|
||||
@"cp_info": @"QXUserCpInfoModel",
|
||||
@"master": @"QXUserHomeModel",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -295,6 +295,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
+(void)joinRoomWithRoomId:(NSString*)room_id
|
||||
successBlock:(void (^)(QXRoomModel* roomModel))successBlock
|
||||
roomErrorBlock:(void (^)(NSString * roomId, NSString * msg))roomErrorBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
|
||||
@@ -1377,6 +1378,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
/**
|
||||
申请加入公会
|
||||
*/
|
||||
|
||||
+(void)joinGuildWithGuildId:(NSString*)guild_id
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -588,15 +588,30 @@
|
||||
}];
|
||||
}
|
||||
|
||||
+(void)joinRoomWithRoomId:(NSString *)room_id successBlock:(void (^)(QXRoomModel * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
+(void)joinRoomWithRoomId:(NSString *)room_id successBlock:(nonnull void (^)(QXRoomModel * _Nonnull))successBlock roomErrorBlock:(nonnull void (^)(NSString * _Nonnull, NSString * _Nonnull))roomErrorBlock failBlock:(nonnull void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
NSDictionary *parameters =@{
|
||||
@"room_id":room_id
|
||||
};
|
||||
[[QXRequset shareInstance] postWithUrl:QXJoinRoom parameters:parameters needCache:NO success:^(id responseObject) {
|
||||
int code = [responseObject[@"code"] intValue];
|
||||
if(code == 202){
|
||||
id object = responseObject[@"data"];
|
||||
NSString *roomId = @"";
|
||||
NSString*content = @"";
|
||||
if ([object isKindOfClass:[NSDictionary class]]) {
|
||||
roomId = [NSString stringWithFormat:@"%@",object[@"room_id"]];
|
||||
content = [NSString stringWithFormat:@"%@",object[@"msg"]];
|
||||
}
|
||||
if (roomErrorBlock) {
|
||||
roomErrorBlock(roomId,content);
|
||||
}
|
||||
}else{
|
||||
if (successBlock) {
|
||||
QXRoomModel *model = [QXRoomModel yy_modelWithJSON:responseObject[@"data"]];
|
||||
successBlock(model);
|
||||
}
|
||||
}
|
||||
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
@@ -2762,4 +2777,23 @@
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
/**
|
||||
申请加入公会
|
||||
*/
|
||||
|
||||
+(void)joinGuildWithGuildId:(NSString*)guild_id
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
|
||||
NSDictionary *parameters =@{
|
||||
@"guild_id":guild_id?:@"",
|
||||
};
|
||||
[[QXRequset shareInstance] postWithUrl:QXApplyJoinGuild parameters:parameters needCache:NO success:^(id responseObject) {
|
||||
if (successBlock) {
|
||||
successBlock(responseObject[@"data"]);
|
||||
}
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -230,6 +230,7 @@
|
||||
|
||||
self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(self.topBgView.left, self.topBgView.bottom+12, self.topBgView.width, 64) delegate:self placeholderImage:nil];
|
||||
self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
|
||||
self.cycleScrollView.backgroundColor = UIColor.clearColor;
|
||||
[self.cycleScrollView addRoundedCornersWithRadius:8];
|
||||
[self addSubview:self.cycleScrollView];
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
|
||||
QXServiceModel *md5 = [[QXServiceModel alloc] init];
|
||||
md5.title = @"家族";
|
||||
md5.icon = @"service_setting";
|
||||
md5.icon = @"service_my_family";
|
||||
md5.type = QXMineServiceTypeFamily;
|
||||
|
||||
_serviceArray = [NSMutableArray arrayWithArray:@[
|
||||
|
||||
@@ -23,6 +23,15 @@
|
||||
@interface QXUserHomeHeaderView()<UICollectionViewDelegate,UICollectionViewDataSource,QXUserCpCardViewDelegate>
|
||||
//@property (nonatomic,strong) CKShimmerLabel * tempName;
|
||||
@property (nonatomic,strong) QXSeatHeaderView* headerView;
|
||||
/// 师傅
|
||||
@property (nonatomic,strong)UIView *masterView;
|
||||
/// 师傅
|
||||
@property (nonatomic,strong)QXSeatHeaderView *masterHeaderView;
|
||||
/// 师傅
|
||||
@property (nonatomic,strong)UIImageView *masterViewIcon;
|
||||
/// 师傅
|
||||
@property (nonatomic,strong)UIButton *masterViewButton;
|
||||
|
||||
@property (nonatomic,strong) UIView * whiteBgView;
|
||||
@property (nonatomic,strong) UIView * grayBgView;
|
||||
@property (nonatomic,strong) CKShimmerLabel * nameLabel;
|
||||
@@ -67,6 +76,38 @@
|
||||
make.top.mas_equalTo(26);
|
||||
}];
|
||||
|
||||
self.masterView = [[UIView alloc] init];
|
||||
self.masterView.hidden = YES;
|
||||
[self addSubview:self.masterView];
|
||||
[self.masterView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.headerView);
|
||||
make.left.equalTo(self.headerView.mas_right);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(45), ScaleWidth(45+16)));
|
||||
}];
|
||||
|
||||
self.masterHeaderView = [[QXSeatHeaderView alloc] init];
|
||||
self.masterHeaderView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.masterView addSubview:self.masterHeaderView];
|
||||
//
|
||||
[self.masterHeaderView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.equalTo(self.masterView);
|
||||
make.height.equalTo(self.masterHeaderView.mas_width);
|
||||
}];
|
||||
|
||||
self.masterViewIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_info_master_icon"]];
|
||||
[self.masterView insertSubview:self.masterViewIcon aboveSubview:self.masterHeaderView];
|
||||
[self.masterViewIcon mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.masterHeaderView.mas_bottom).offset(-8);
|
||||
make.centerX.equalTo(self.masterView);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(30), ScaleWidth(16)));
|
||||
}];
|
||||
self.masterViewButton = [[UIButton alloc] init];
|
||||
[self.masterViewButton addTarget:self action:@selector(toMasterUserHome) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.masterView addSubview:self.masterViewButton];
|
||||
[self.masterViewButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.masterView);
|
||||
}];
|
||||
|
||||
self.nameLabel = [[CKShimmerLabel alloc] initWithFrame:CGRectMake(32, self.headerView.bottom+4, 200, 24)];
|
||||
// self.nameLabel.text = @"羽声语音";
|
||||
self.nameLabel.shimmerWidth = 20;
|
||||
@@ -305,6 +346,13 @@
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)toMasterUserHome{
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
NSString *userId = self.model.master.user_id;
|
||||
vc.user_id = userId;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(void)followAction{
|
||||
MJWeakSelf
|
||||
[QXDynamicNetwork followWithUserId:self.model.user_id type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
@@ -369,6 +417,12 @@
|
||||
[self.headerView setHeadIcon:model.avatar dress:model.dress];
|
||||
[self.headerView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:model.nobility_image]];
|
||||
|
||||
if (model.master) {
|
||||
self.masterView.hidden = NO;
|
||||
[self.masterHeaderView setHeadIcon:model.master.avatar dress:model.master.dress];
|
||||
}else{
|
||||
self.masterView.hidden = YES;
|
||||
}
|
||||
|
||||
if ([model.nickname_color isExist]) {
|
||||
self.nameLabel.shimmerColor = [UIColor colorWithHexString:model.nickname_color];
|
||||
|
||||
@@ -9,7 +9,13 @@
|
||||
#import "QXFamilyModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXFamilyMemberCellDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
-(void)needRefresh;
|
||||
|
||||
@end
|
||||
@interface QXFamilyMemberCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *headerView;
|
||||
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
|
||||
@@ -23,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (weak, nonatomic) IBOutlet UIButton *yestodayPriceBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *continueBtn;
|
||||
@property (strong, nonatomic) QXFamilyMemberModel *model;
|
||||
@property (weak, nonatomic)id<QXFamilyMemberCellDelegate>delegate;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#import "QXFamilyMemberCell.h"
|
||||
#import "QXUserHomeHeaderView.h"
|
||||
#import "QXCustomAlertView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXFamilyMemberCell()<UICollectionViewDataSource,UICollectionViewDelegate>
|
||||
@end
|
||||
@implementation QXFamilyMemberCell
|
||||
@@ -35,7 +37,7 @@
|
||||
}
|
||||
-(void)setModel:(QXFamilyMemberModel *)model{
|
||||
_model = model;
|
||||
[self.headerView setHeadIcon:model.nickname dress:model.dress];
|
||||
[self.headerView setHeadIcon:model.avatar dress:model.dress];
|
||||
[self.headerView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:model.nobility_image]];
|
||||
self.dayLabel.text = [NSString stringWithFormat:@"剩余租期:%@",model.end_day];
|
||||
self.timesLabel.text = [NSString stringWithFormat:@"免费续约次数:%@",model.free_renewal];
|
||||
@@ -47,20 +49,66 @@
|
||||
self.continueBtn.hidden = model.is_show_sign.intValue==1?NO:YES;
|
||||
}
|
||||
- (IBAction)continueAction:(id)sender {
|
||||
|
||||
QXCustomAlertView *al = [[QXCustomAlertView alloc] init];
|
||||
al.title = @"续约提示";
|
||||
al.message = @"尊敬的用户: 您的徒弟【夏沫】当前为首次签约的 免费续约期。续约后,徒弟合约将延长7天,您剩余的免费续约次数:1次";
|
||||
|
||||
al.cancleTitle = @"取消";
|
||||
al.commitTitle = @"确认续约";
|
||||
al.isFromController = YES;
|
||||
if (self.model.free_renewal.intValue>0) {
|
||||
al.message = [NSString stringWithFormat:@"尊敬的用户: 您的徒弟【%@】当前为首次签约的 免费续约期。续约后,徒弟合约将延长%@天,您剩余的免费续约次数:%d次",self.model.nickname,self.model.free_re_sign_day,self.model.free_renewal.intValue-1];
|
||||
}else{
|
||||
NSInteger currentFeeInt = (NSInteger)ceil(self.model.market_value.doubleValue*self.model.sign_user_ratio.doubleValue/100.0);
|
||||
NSString *currentFee = [NSString stringWithFormat:@"%ld",currentFeeInt];
|
||||
al.message = [NSString stringWithFormat:@"尊敬的用户:本次续约将预估支付%@金币(【%@】身价的 %@%% )作为续约费用,续约后,师徒合约将延长 %@ 天\n注:支付价格是预估价格,徒弟身价是实时变化 续约后无法取消",currentFee,self.model.nickname,self.model.sign_user_ratio,self.model.sign_times];
|
||||
}
|
||||
MJWeakSelf
|
||||
al.cancelBlock = ^{
|
||||
[[QXGlobal shareGlobal] hideViewBlock:nil];
|
||||
};
|
||||
al.commitBlock = ^{
|
||||
[[QXGlobal shareGlobal] hideViewBlock:nil];
|
||||
if (weakSelf.model.free_renewal.intValue>0) {
|
||||
[weakSelf networkFreeSign];
|
||||
}else{
|
||||
[weakSelf networkCoinSign];
|
||||
}
|
||||
};
|
||||
[QXGlobal.shareGlobal showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:nil];
|
||||
// [al showInView:self.viewController.view title:@"续约提示" message:@"尊敬的用户: 您的徒弟【夏沫】当前为首次签约的 免费续约期。续约后,徒弟合约将延长7天,您剩余的免费续约次数:1次" cancleTitle:@"取消" commitTitle:@"确认续约"];
|
||||
}
|
||||
|
||||
-(void)networkFreeSign{
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[QXMineNetwork signFreeResignWithUserId:self.model.user_id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
showToast(@"续约成功");
|
||||
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (!strongSelf) {
|
||||
NSLog(@"⚠️ self has been deallocated, skipping hide operation");
|
||||
return;
|
||||
}
|
||||
if (strongSelf.delegate && [strongSelf.delegate respondsToSelector:@selector(needRefresh)]) {
|
||||
[strongSelf.delegate needRefresh];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
-(void)networkCoinSign{
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[QXMineNetwork signCoinResignWithUserId:self.model.user_id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
showToast(@"续约成功");
|
||||
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (!strongSelf) {
|
||||
NSLog(@"⚠️ self has been deallocated, skipping hide operation");
|
||||
return;
|
||||
}
|
||||
if (strongSelf.delegate && [strongSelf.delegate respondsToSelector:@selector(needRefresh)]) {
|
||||
[strongSelf.delegate needRefresh];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
if (self.model==nil) {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
if (self.model.group_members_lists.count == 0) {
|
||||
showToast(@"家族群至少需要签约一位徒弟");
|
||||
}else{
|
||||
[[QXGlobal shareGlobal] chatWithGroupId:self.model.group_id cover:self.model.group_owner_info.avatar name:[NSString stringWithFormat:@"%@的家族",self.model.group_owner_info.nickname] navagationController:self.viewController.navigationController];
|
||||
[[QXGlobal shareGlobal] chatWithFamilyGroupId:self.model.group_id cover:self.model.group_owner_info.avatar name:[NSString stringWithFormat:@"%@的家族",self.model.group_owner_info.nickname] navagationController:self.viewController.navigationController];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (weak, nonatomic) IBOutlet UILabel *reasonLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
|
||||
@property (nonatomic,assign)BOOL isCoin;
|
||||
@property (nonatomic,strong) QXCoinDetailModel *model;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
}
|
||||
-(void)setIsCoin:(BOOL)isCoin{
|
||||
_isCoin = isCoin;
|
||||
self.iconImageView.image = [UIImage imageNamed:isCoin?@"mine_recharge_corn":@"family_diamond"];
|
||||
}
|
||||
-(void)setModel:(QXCoinDetailModel *)model{
|
||||
_model = model;
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="iconImageView" destination="otM-9U-0Vb" id="jyY-jW-Ysm"/>
|
||||
<outlet property="priceLabel" destination="Fxs-N2-aqw" id="rfF-fe-gWN"/>
|
||||
<outlet property="reasonLabel" destination="9Ov-rS-XTy" id="JXd-OS-yeh"/>
|
||||
<outlet property="timeLabel" destination="fEd-EE-hdG" id="4VS-rn-KzE"/>
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#import "OpenUDID.h"
|
||||
static AFNetworkReachabilityStatus AFNetWorkStatus; //网络状态
|
||||
static NSInteger HTTP_LOGINLOSE_CODE = 301;
|
||||
/// 房间接口code 202
|
||||
static NSInteger HTTP_ROOM_ERROR_CODE = 202;
|
||||
static NSInteger HTTP_SUCCESS_CODE = 1;
|
||||
static NSInteger HTTP_ERROR_CODE = 0;
|
||||
|
||||
|
||||
22
QXLive/Other/Assets.xcassets/mine/service_my_family.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "service_my_family@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "service_my_family@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
QXLive/Other/Assets.xcassets/mine/service_my_family.imageset/service_my_family@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
QXLive/Other/Assets.xcassets/mine/service_my_family.imageset/service_my_family@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
22
QXLive/Other/Assets.xcassets/room/user_info_master_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "user_info_master_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "user_info_master_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
QXLive/Other/Assets.xcassets/room/user_info_master_icon.imageset/user_info_master_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
QXLive/Other/Assets.xcassets/room/user_info_master_icon.imageset/user_info_master_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
22
QXLive/Other/Assets.xcassets/room/签约房/room_sign_fail.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sign_fail@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sign_fail@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
QXLive/Other/Assets.xcassets/room/签约房/room_sign_fail.imageset/room_sign_fail@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 282 KiB |
BIN
QXLive/Other/Assets.xcassets/room/签约房/room_sign_fail.imageset/room_sign_fail@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 601 KiB |
22
QXLive/Other/Assets.xcassets/room/签约房/room_sign_fail_btn.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sign_fail_btn@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sign_fail_btn@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
QXLive/Other/Assets.xcassets/room/签约房/room_sign_fail_btn.imageset/room_sign_fail_btn@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
QXLive/Other/Assets.xcassets/room/签约房/room_sign_fail_btn.imageset/room_sign_fail_btn@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 106 KiB |
22
QXLive/Other/Assets.xcassets/room/签约房/room_sign_start.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sign_start@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sign_start@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
QXLive/Other/Assets.xcassets/room/签约房/room_sign_start.imageset/room_sign_start@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 320 KiB |
BIN
QXLive/Other/Assets.xcassets/room/签约房/room_sign_start.imageset/room_sign_start@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 763 KiB |
22
QXLive/Other/Assets.xcassets/room/签约房/room_sign_success.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sign_success@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sign_success@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
QXLive/Other/Assets.xcassets/room/签约房/room_sign_success.imageset/room_sign_success@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 249 KiB |
BIN
QXLive/Other/Assets.xcassets/room/签约房/room_sign_success.imageset/room_sign_success@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 673 KiB |
@@ -524,7 +524,8 @@ static NSString * QXMyJoinFamily = @"api/Family/myJoinFamily";
|
||||
/// 家族收益详情
|
||||
static NSString * QXMyFamilyEarnings = @"api/Family/familyEarnings";
|
||||
|
||||
|
||||
/// 申请加入公会
|
||||
static NSString * QXApplyJoinGuild = @"api/Guild/join_guild";
|
||||
|
||||
/// 签约出价列表
|
||||
static NSString * QXSignCoinList = @"api/Sign/sign_coin_list";
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
[self.seatContentView signDidEndWithUserInfo1:userInfo1 userInfo2:userInfo2 sign_value:sign_value];
|
||||
}
|
||||
/// 签约身价变化
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId{
|
||||
[self.seatContentView signValueDidChangedWithSignUserInfo:signUserInfo sign_value:sign_value signId:signId];
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId sign_coin_list:(NSArray*)sign_coin_list{
|
||||
[self.seatContentView signValueDidChangedWithSignUserInfo:signUserInfo sign_value:sign_value signId:signId sign_coin_list:sign_coin_list];
|
||||
}
|
||||
/// 签约身价变化
|
||||
-(void)signTimeDelayWithEndTime:(NSString*)endTime{
|
||||
|
||||
@@ -314,7 +314,9 @@ QXRoomUserInfoViewDelegate
|
||||
weakSelf.roomModel = roomModel;
|
||||
[self resetSubviews];
|
||||
[self configRoomDataIsJoin:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
|
||||
|
||||
}failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
|
||||
@@ -136,6 +136,7 @@
|
||||
self.countLabel = [[UILabel alloc] init];
|
||||
self.countLabel.textColor = [UIColor whiteColor];
|
||||
self.countLabel.font = [UIFont systemFontOfSize:12];
|
||||
self.countLabel.hidden = YES;
|
||||
[self addSubview:self.countLabel];
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(ScaleWidth(40));
|
||||
|
||||
@@ -30,6 +30,14 @@
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
/// 头像
|
||||
@property (nonatomic,strong)QXSeatHeaderView *headerImageView;
|
||||
/// 师傅
|
||||
@property (nonatomic,strong)UIView *masterView;
|
||||
/// 师傅
|
||||
@property (nonatomic,strong)QXSeatHeaderView *masterHeaderView;
|
||||
/// 师傅
|
||||
@property (nonatomic,strong)UIImageView *masterViewIcon;
|
||||
/// 师傅点击按钮
|
||||
@property (nonatomic,strong)UIButton *masterViewButton;
|
||||
/// 昵称
|
||||
@property (nonatomic,strong)CKShimmerLabel *nameLabel;
|
||||
@property (nonatomic,strong)UIImageView *sexImageView;
|
||||
@@ -123,8 +131,42 @@
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(66), ScaleWidth(79)));
|
||||
}];
|
||||
|
||||
self.masterView = [[UIView alloc] init];
|
||||
self.masterView.hidden = YES;
|
||||
[self.bgView addSubview:self.masterView];
|
||||
[self.masterView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.headerImageView);
|
||||
make.left.equalTo(self.headerImageView.mas_right);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(45), ScaleWidth(45+16)));
|
||||
}];
|
||||
|
||||
self.masterHeaderView = [[QXSeatHeaderView alloc] init];
|
||||
self.masterHeaderView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.masterView addSubview:self.masterHeaderView];
|
||||
//
|
||||
[self.masterHeaderView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.equalTo(self.masterView);
|
||||
make.height.equalTo(self.masterHeaderView.mas_width);
|
||||
}];
|
||||
|
||||
self.masterViewIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_info_master_icon"]];
|
||||
[self.masterView insertSubview:self.masterViewIcon aboveSubview:self.masterHeaderView];
|
||||
[self.masterViewIcon mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.masterHeaderView.mas_bottom).offset(-8);
|
||||
make.centerX.equalTo(self.masterView);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(30), ScaleWidth(16)));
|
||||
}];
|
||||
|
||||
self.masterViewButton = [[UIButton alloc] init];
|
||||
[self.masterViewButton addTarget:self action:@selector(toMasterUserHome) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.masterView addSubview:self.masterViewButton];
|
||||
[self.masterViewButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.masterView);
|
||||
}];
|
||||
|
||||
|
||||
UIButton *headder = [[UIButton alloc] init];
|
||||
[headder addTarget:self action:@selector(toHomePage) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[headder addTarget:self action:@selector(toUserHome) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.bgView addSubview:headder];
|
||||
[headder mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.left.right.top.equalTo(self.headerImageView);
|
||||
@@ -485,11 +527,22 @@
|
||||
-(void)followAction{
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.roomId isRejoin:NO navagationController:self.viewController.navigationController];
|
||||
}
|
||||
-(void)toMasterUserHome{
|
||||
[self toHomePageIsMaster:YES];
|
||||
}
|
||||
-(void)toUserHome{
|
||||
[self toHomePageIsMaster:NO];
|
||||
}
|
||||
|
||||
-(void)toHomePage{
|
||||
-(void)toHomePageIsMaster:(BOOL)isMaster{
|
||||
[self hide];
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
NSString *userId = self.userId;
|
||||
if (isMaster) {
|
||||
userId = self.userModel.master.user_id;
|
||||
}else{
|
||||
userId = self.userId;
|
||||
}
|
||||
vc.user_id = userId;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
@@ -590,6 +643,12 @@
|
||||
}else{
|
||||
[weakSelf.nameLabel stopShimmer];
|
||||
}
|
||||
if (model.master) {
|
||||
weakSelf.masterView.hidden = NO;
|
||||
[weakSelf.masterHeaderView setHeadIcon:model.master.avatar dress:model.master.dress];
|
||||
}else{
|
||||
weakSelf.masterView.hidden = YES;
|
||||
}
|
||||
weakSelf.nameLabel.text = model.nickname;
|
||||
[weakSelf.nameLabel.contentLabel sizeToFit];
|
||||
[weakSelf.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -920,6 +979,11 @@
|
||||
}
|
||||
if (sender == self.joinGuildBtn) {
|
||||
QXLOG(@"加入公会");
|
||||
[QXMineNetwork joinGuildWithGuildId:self.userModel.guild successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if (sender == self.focusBtn) {
|
||||
|
||||
21
QXLive/Room(房间)/View/签约房/QXSignAlertView.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// QXSignAlertView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/12/1.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
QXSignAlerTypeStart = 0,
|
||||
QXSignAlerTypeFail = 1,
|
||||
QXSignAlerTypeSuccess = 2,
|
||||
}QXSignAlerType;
|
||||
@interface QXSignAlertView : UIView
|
||||
-(instancetype)initWithType:(QXSignAlerType)type;
|
||||
-(void)showInView:(UIView*)view;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
130
QXLive/Room(房间)/View/签约房/QXSignAlertView.m
Normal file
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// QXSignAlertView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/12/1.
|
||||
//
|
||||
|
||||
#import "QXSignAlertView.h"
|
||||
@interface QXSignAlertView()
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UIImageView *imageView;
|
||||
@property (nonatomic,strong)UIButton *closeBtn;
|
||||
@property (assign,nonatomic)QXSignAlerType type;
|
||||
@end
|
||||
|
||||
@implementation QXSignAlertView
|
||||
-(instancetype)initWithType:(QXSignAlerType)type{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_type = type;
|
||||
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
[self initSubviewsWithType:type];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviewsWithType:(QXSignAlerType)type{
|
||||
self.bgView = [[UIView alloc] init];
|
||||
[self addSubview:self.bgView];
|
||||
|
||||
switch (type) {
|
||||
case QXSignAlerTypeStart:{
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(ScaleWidth(222));
|
||||
make.height.mas_equalTo(ScaleWidth(222));
|
||||
make.centerX.centerY.equalTo(self);
|
||||
}];
|
||||
|
||||
self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_start"]];
|
||||
self.imageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self.bgView addSubview:self.imageView];
|
||||
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.bgView);
|
||||
}];
|
||||
}
|
||||
|
||||
break;
|
||||
case QXSignAlerTypeFail:
|
||||
{
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(ScaleWidth(272));
|
||||
make.height.mas_equalTo(ScaleWidth(397));
|
||||
make.centerX.centerY.equalTo(self);
|
||||
}];
|
||||
|
||||
self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_fail"]];
|
||||
[self.bgView addSubview:self.imageView];
|
||||
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.bgView);
|
||||
}];
|
||||
|
||||
self.closeBtn = [[UIButton alloc] init];
|
||||
[self.closeBtn setBackgroundImage:[UIImage imageNamed:@"room_sign_fail_btn"] forState:(UIControlStateNormal)];
|
||||
[self.closeBtn addTarget:self action:@selector(hide) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.bgView addSubview:self.closeBtn];
|
||||
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(ScaleWidth(-29));
|
||||
make.width.mas_equalTo(ScaleWidth(139));
|
||||
make.height.mas_equalTo(ScaleWidth(51));
|
||||
make.centerX.equalTo(self.bgView);
|
||||
}];
|
||||
|
||||
}
|
||||
break;
|
||||
case QXSignAlerTypeSuccess:
|
||||
{
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(ScaleWidth(222));
|
||||
make.height.mas_equalTo(ScaleWidth(222));
|
||||
make.centerX.centerY.equalTo(self);
|
||||
}];
|
||||
self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_success"]];
|
||||
[self.bgView addSubview:self.imageView];
|
||||
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.bgView);
|
||||
}];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)showInView:(UIView*)view{
|
||||
[view addSubview:self];
|
||||
self.bgView.alpha = 0;
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.alpha = 1;
|
||||
}completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
[self performSelector:@selector(hide) afterDelay:1];
|
||||
}
|
||||
|
||||
- (void)hide{
|
||||
if (!self.superview) {
|
||||
NSLog(@"⚠️ View already removed from superview");
|
||||
return;
|
||||
}
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (!strongSelf) {
|
||||
NSLog(@"⚠️ self has been deallocated, skipping hide operation");
|
||||
return;
|
||||
}
|
||||
self.bgView.alpha = 0;
|
||||
}completion:^(BOOL finished) {
|
||||
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||
if (!strongSelf) {
|
||||
NSLog(@"⚠️ self has been deallocated, skipping hide operation");
|
||||
return;
|
||||
}
|
||||
if (self.superview) {
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
}];
|
||||
}
|
||||
@end
|
||||
@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)NSString *signId;
|
||||
@property (nonatomic,weak)id<QXSignCoinListViewDelegate>delegate;
|
||||
@property (nonatomic,strong)QXRoomPitModel *pitModel;
|
||||
-(void)refreshCoinList;
|
||||
-(void)refreshCoinListWith:(NSArray*)coinList;
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
@@ -210,11 +210,21 @@
|
||||
[weakSelf.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf getCoinList];
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)refreshCoinList{
|
||||
[self getCoinList];
|
||||
-(void)refreshCoinListWith:(NSArray *)coinList{
|
||||
[self getMyWallet];
|
||||
[self.dataArray removeAllObjects];
|
||||
for (NSString*title in coinList) {
|
||||
QXRoomRelationModel *md = [[QXRoomRelationModel alloc] init];
|
||||
md.name = title;
|
||||
[self.dataArray addObject:md];
|
||||
}
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
-(void)showInView:(UIView *)view{
|
||||
[self getCoinList];
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
NSInteger itemWidth = (SCREEN_WIDTH-16*2-12*3)/4;
|
||||
layout.itemSize = CGSizeMake(itemWidth, 44);
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom, self.bgView.width, self.commitBtn.top-self.titleLabel.bottom-10) collectionViewLayout:layout];
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+10, self.bgView.width, self.commitBtn.top-self.titleLabel.bottom-20) collectionViewLayout:layout];
|
||||
[self.collectionView registerClass:[QXSelectAuctionInfoCell class] forCellWithReuseIdentifier:@"QXSelectAuctionInfoCell"];
|
||||
self.collectionView.delegate = self;
|
||||
self.collectionView.dataSource = self;
|
||||
@@ -100,8 +100,8 @@
|
||||
showToast(@"请选择您要展示的才艺");
|
||||
return;
|
||||
}
|
||||
|
||||
[[QXRoomMessageManager shared] sendChatMessage:[NSString stringWithFormat:@"选择的才艺是 %@",self.selectedModel.name] messageType:(QXRoomMessageTypeText) needInsertMessage:YES];
|
||||
[self hide];
|
||||
}
|
||||
|
||||
-(void)getPlayList{
|
||||
|
||||
@@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 签约结束
|
||||
-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value;
|
||||
/// 签约身价变化
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId;
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId sign_coin_list:(NSArray*)sign_coin_list;
|
||||
/// 签约发生延时
|
||||
-(void)signTimeDelayWithEndTime:(NSString*)endTime;
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXCustomAlertView.h"
|
||||
#import "QXRechargeView.h"
|
||||
#import "QXSignAlertView.h"
|
||||
|
||||
@interface QXRoomSeatTypeSignView()<QXRoomSeatDelegate,QXSignCoinListViewDelegate>
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@@ -95,7 +96,7 @@
|
||||
[self.compereView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.bgImageView).offset(5);
|
||||
make.width.mas_equalTo(ScaleWidth(45));
|
||||
make.height.mas_equalTo(ScaleWidth(45-10)+30);
|
||||
make.height.mas_equalTo(ScaleWidth(45-10)+51);
|
||||
make.left.equalTo(self.bgImageView).offset(5);
|
||||
}];
|
||||
|
||||
@@ -287,7 +288,7 @@
|
||||
make.left.equalTo(self.bgImageView).offset(22);
|
||||
make.width.mas_equalTo(ScaleWidth(84));
|
||||
make.height.mas_equalTo(ScaleWidth(94));
|
||||
make.top.mas_equalTo(ScaleWidth(78)+10);
|
||||
make.top.mas_equalTo(ScaleWidth(78)+20);
|
||||
}];
|
||||
|
||||
self.priceTitleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_title_image"]];
|
||||
@@ -747,6 +748,8 @@
|
||||
}
|
||||
|
||||
-(void)signDidStartWithEndTime:(NSString *)endTime signId:(NSString *)signId signDay:(NSString*)signDay signValue:(NSString*)signValue{
|
||||
QXSignAlertView *startView = [[QXSignAlertView alloc] initWithType:(QXSignAlerTypeStart)];
|
||||
[startView showInView:self.viewController.view];
|
||||
self.roomModel.sign_info.sign_id = signId;
|
||||
self.roomModel.sign_info.sign_status = @"1";
|
||||
self.roomModel.sign_info.end_time = endTime;
|
||||
@@ -759,6 +762,13 @@
|
||||
}
|
||||
/// 签约结束
|
||||
-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value{
|
||||
if (userInfo1 && userInfo2) {
|
||||
QXSignAlertView *startView = [[QXSignAlertView alloc] initWithType:(QXSignAlerTypeSuccess)];
|
||||
[startView showInView:self.viewController.view];
|
||||
}else{
|
||||
QXSignAlertView *startView = [[QXSignAlertView alloc] initWithType:(QXSignAlerTypeFail)];
|
||||
[startView showInView:self.viewController.view];
|
||||
}
|
||||
self.roomModel.sign_info.sign_id = @"";
|
||||
self.roomModel.sign_info.sign_status = @"0";
|
||||
[self configStatus];
|
||||
@@ -768,14 +778,14 @@
|
||||
}
|
||||
}
|
||||
/// 签约身价变化
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId{
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId sign_coin_list:(NSArray*)sign_coin_list{
|
||||
if (![self.roomModel.sign_info.sign_id isEqualToString:signId]) {
|
||||
showToast(@"场次错误");
|
||||
return;
|
||||
}
|
||||
self.priceLabel.text = sign_value;
|
||||
if (_coinView) {
|
||||
[_coinView refreshCoinList];
|
||||
[_coinView refreshCoinListWith:sign_coin_list];
|
||||
}
|
||||
}
|
||||
/// 签约发生延时
|
||||
|
||||
@@ -136,7 +136,7 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 签约结束
|
||||
-(void)signDidEndWithUserInfo1:(QXUserHomeModel*)userInfo1 userInfo2:(QXUserHomeModel*)userInfo2 sign_value:(NSString*)sign_value;
|
||||
/// 签约身价变化
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId;
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId sign_coin_list:(NSArray*)sign_coin_list;
|
||||
/// 签约身价变化
|
||||
-(void)signTimeDelayWithEndTime:(NSString*)endTime;
|
||||
@end
|
||||
|
||||
@@ -1224,9 +1224,9 @@
|
||||
}
|
||||
}
|
||||
/// 签约身价变化
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId{
|
||||
-(void)signValueDidChangedWithSignUserInfo:(QXUserHomeModel*)signUserInfo sign_value:(NSString*)sign_value signId:(NSString*)signId sign_coin_list:(NSArray*)sign_coin_list{
|
||||
if (_signView) {
|
||||
[self.signView signValueDidChangedWithSignUserInfo:signUserInfo sign_value:sign_value signId:signId];
|
||||
[self.signView signValueDidChangedWithSignUserInfo:signUserInfo sign_value:sign_value signId:signId sign_coin_list:sign_coin_list];
|
||||
}
|
||||
}
|
||||
/// 签约发生延时
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
-(void)setMessage:(NSString *)message{
|
||||
_message = message;
|
||||
CGFloat messageHeight = [message heightForFont:[UIFont systemFontOfSize:13] width:ScaleWidth(275)-1];
|
||||
CGFloat messageHeight = [message heightForFont:[UIFont systemFontOfSize:13] width:ScaleWidth(275)-1-32];
|
||||
CGFloat contentHeight = 16+24+13+42+12+14+messageHeight;
|
||||
if (contentHeight < 180) {
|
||||
contentHeight = 180;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
@property (nonatomic,weak)UIView* containerView;
|
||||
@property (nonatomic,assign)BOOL isPlaying;
|
||||
@property (nonatomic,assign)BOOL isClose;
|
||||
@property (nonatomic,assign)BOOL isBackgroud;
|
||||
@end
|
||||
@implementation QXDrifNobilityJoinRoomView
|
||||
|
||||
@@ -75,6 +76,9 @@
|
||||
if (self.isPlaying) {
|
||||
return;
|
||||
}
|
||||
if (self.isBackgroud) {
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
[QXDrifNobilityJoinRoomView shareView].isPlaying = YES;
|
||||
[QXDrifNobilityJoinRoomView shareView].model = [QXDrifNobilityJoinRoomView shareView].dataArray.firstObject;
|
||||
@@ -142,6 +146,7 @@
|
||||
}
|
||||
}
|
||||
-(void)dirfViewDidToBackground{
|
||||
self.isBackgroud = YES;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[QXDrifNobilityJoinRoomView shareView].x = SCREEN_WIDTH;
|
||||
[[QXDrifNobilityJoinRoomView shareView] removeFromSuperview];
|
||||
@@ -151,6 +156,7 @@
|
||||
}
|
||||
|
||||
-(void)dirfViewBecomeToFront{
|
||||
self.isBackgroud = NO;
|
||||
if ([QXDrifNobilityJoinRoomView shareView].isPlaying == NO) {
|
||||
[QXDrifNobilityJoinRoomView shareView].x = SCREEN_WIDTH;
|
||||
[[QXDrifNobilityJoinRoomView shareView] removeFromSuperview];
|
||||
|
||||
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 39 KiB |