This commit is contained in:
启星
2025-12-13 00:43:57 +08:00
parent ad6cd82a05
commit 999bf3d804
41 changed files with 1017 additions and 168 deletions

View File

@@ -25,6 +25,8 @@ typedef NS_ENUM(NSInteger) {
QXRoomMessageTypeSendAndRecieveCpHeartSignal = 130,
/// cp双向奔赴
QXRoomMessageTypeCpHeartFinished = 131,
/// 师徒任务
QXRoomMessageTypeMasterTask = 132,
/// 基础文本消息类型
QXRoomMessageTypeText = 1,

View File

@@ -791,6 +791,21 @@
};
}
-(void)showMasterTaskInviteAlertViewWithRoomId:(NSString*)roomId userId:(NSString*)userId{
QXCustomAlertView *alertView = [[QXCustomAlertView alloc] init];
alertView.autoDismissTime = 10;
[alertView showInView:KEYWINDOW title:@"温馨提示" message:@"您的师傅邀请您进入房间,您是否同意?" cancleTitle:@"拒绝" commitTitle:@"同意"];
alertView.cancelBlock = ^{
NSDictionary *dict = @{@"status":@"2",@"room_id":roomId?:@""};
NSString *jsonStr = [dict jsonStringEncoded];
[[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeMasterTask) userId:userId];
};
alertView.commitBlock = ^{
QXLOG(@"进入房间");
[[QXGlobal shareGlobal] joinRoomWithRoomId:roomId isRejoin:NO navagationController:(QXRoomNavigationController*)KEYWINDOW.rootViewController];
};
}
-(void)onRecvC2CTextMessage:(NSString *)msgID sender:(V2TIMUserInfo *)info text:(NSString *)text{
}
@@ -823,6 +838,17 @@
NSDictionary *dict = [json jsonValueDecoded];
NSString *message = [NSString stringWithFormat:@"%@",dict[@"text1"]];
[self showCpFinishedAlertViewWithText:message];
}else if (meesageType == QXRoomMessageTypeMasterTask){
NSString *json = [NSString stringWithFormat:@"%@",msg.Text[@"text"]];
NSDictionary *dict = [json jsonValueDecoded];
NSString *status = [NSString stringWithFormat:@"%@",dict[@"status"]];
if ([status isEqualToString:@"2"]) {
showToast(@"您的徒弟拒绝了您的邀请");
}else if ([status isEqualToString:@"1"]){
NSString *roomId = [NSString stringWithFormat:@"%@",dict[@"room_id"]];
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
[self showMasterTaskInviteAlertViewWithRoomId:roomId userId:model.FromUserInfo.user_id];
}
}
}
-(void)onRecvGroupCustomMessage:(NSString *)msgID groupID:(NSString *)groupID sender:(V2TIMGroupMemberInfo *)info customData:(NSData *)data{