This commit is contained in:
启星
2025-10-30 00:45:15 +08:00
parent acc4cffad2
commit aa356202e2
96 changed files with 881 additions and 303 deletions

View File

@@ -11,7 +11,10 @@
#import "TUIChatConfig_Classic.h"
#import "QXUserHomePageViewController.h"
#import "QXGuildGroupSettingVC.h"
@interface QXChatViewController ()<TUIChatConfigDelegate_Classic>
#import "QXMenuPopView.h"
#import "QXReportViewController.h"
#import "QXMineNetwork.h"
@interface QXChatViewController ()<TUIChatConfigDelegate_Classic,QXMenuPopViewDelegate>
@property (nonatomic,strong)QXChatTitleView *titleView;
@end
@@ -35,11 +38,14 @@
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
[backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
UIButton*moreBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
[moreBtn setImage:[UIImage imageNamed:@"dynamic_more"] forState:(UIControlStateNormal)];
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
[moreBtn addTarget:self action:@selector(moreAction) forControlEvents:(UIControlEventTouchUpInside)];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:moreBtn];
}
-(BOOL)onUserAvatarClicked:(UIView *)view messageCellData:(TUIMessageCellData *)celldata{
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
NSString *userId = [celldata.identifier stringByReplacingOccurrencesOfString:@"u" withString:@""];
@@ -69,11 +75,32 @@
}
}
-(void)moreAction{
QXGuildGroupSettingVC *vc = [[QXGuildGroupSettingVC alloc] init];
vc.groupId = [self.data.groupID stringByReplacingOccurrencesOfString:@"g" withString:@""];
[self.navigationController pushViewController:vc animated:YES];
if (self.data.groupID.length>0) {
QXGuildGroupSettingVC *vc = [[QXGuildGroupSettingVC alloc] init];
vc.groupId = [self.data.groupID stringByReplacingOccurrencesOfString:@"g" withString:@""];
[self.navigationController pushViewController:vc animated:YES];
}else{
QXMenuPopView *menuView = [[QXMenuPopView alloc] initWithPoint:CGPointMake(SCREEN_WIDTH-60, NavContentHeight+10)];
menuView.dataArray = @[QXText(@"举报"),QXText(@"拉黑")];
menuView.delegate = self;
[menuView showInView:KEYWINDOW];
}
}
-(void)didSelectedIndex:(NSInteger)index menuTitle:(NSString*)menuTitle{
NSString *userId = [self.data.userID substringFromIndex:1];
if ([menuTitle isEqualToString:QXText(@"举报")]) {
QXReportViewController *reportVC = [[QXReportViewController alloc] init];
reportVC.reportType = @"1";
reportVC.fromId = userId;
[self.navigationController pushViewController:reportVC animated:YES];
}else if ([menuTitle isEqualToString:QXText(@"拉黑")]) {
[QXMineNetwork addOrRemoveBlackListIsAdd:YES userId:userId successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}
- (void)initSubViews{
[TUIChatConfig_Classic sharedConfig].delegate = self;
@@ -84,11 +111,7 @@
vc.view.frame = CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight);
[self addChildViewController:vc];
[self.view addSubview:vc.view];
UIButton*moreBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
[moreBtn setImage:[UIImage imageNamed:@"dynamic_more"] forState:(UIControlStateNormal)];
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
[moreBtn addTarget:self action:@selector(moreAction) forControlEvents:(UIControlEventTouchUpInside)];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:moreBtn];
}else{
TUIC2CChatViewController *vc = [[TUIC2CChatViewController alloc] init];
[vc setConversationData:self.data];