This commit is contained in:
启星
2026-01-14 20:36:58 +08:00
parent 705d891c51
commit 5548f5d6a5
64 changed files with 482 additions and 103 deletions

View File

@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXChatViewController : QXBaseViewController
@property (nonatomic,strong)TUIChatConversationModel *data;
@property (nonatomic,assign)BOOL isServices;
@end
NS_ASSUME_NONNULL_END

View File

@@ -118,6 +118,7 @@
}else{
TUIC2CChatViewController *vc = [[TUIC2CChatViewController alloc] init];
vc.isServices = self.isServices;
[vc setConversationData:self.data];
// TUIC2CChatViewController ViewController
vc.view.frame = CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight);

View File

@@ -13,11 +13,14 @@
#import "QXSystemTopView.h"
#import "QXSystemNoticeViewController.h"
#import "QXMessageServices.h"
#import "AppDelegate.h"
@interface QXMessageViewController ()<TUIConversationListControllerListener,QXSystemTopViewDelegate>
@property (nonatomic,strong)QXSystemTopView *topView;
@property (nonatomic,strong)QXMessageModel *model;
@property (nonatomic,strong)TUIConversationListController *vc;
@property (nonatomic,strong)NSString *service_user_id;
@property (nonatomic,strong)NSString *service_user_name;
@end
@implementation QXMessageViewController
@@ -102,6 +105,11 @@
data.groupID = conversation.groupID;
data.title = conversation.title;
data.faceUrl = conversation.faceUrl;
if ([conversation.userID isEqualToString:[NSString stringWithFormat:@"u%@",self.service_user_id]]) {
vc.isServices = YES;
}else{
vc.isServices = NO;
}
vc.data = data;
[self.vc.dataProvider markConversationAsRead:conversation];
[self.navigationController pushViewController:vc animated:YES];
@@ -117,6 +125,15 @@
[QXMessageServices getHomeMessageSuccessBlock:^(QXMessageModel * _Nonnull model) {
weakSelf.model = model;
weakSelf.topView.model = model;
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
delegate.tabbarVC.systemUnreadNumber = model.system_no_read_count.integerValue + model.announcement_read_count.integerValue;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
[QXMessageServices getSerbviceUserSuccessBlock:^(NSString * _Nonnull user_id, NSString * _Nonnull user_name) {
weakSelf.service_user_id = user_id;
weakSelf.service_user_name = user_name;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
@@ -137,7 +154,7 @@
-(QXSystemTopView *)topView{
if (!_topView) {
_topView = [[QXSystemTopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 74+8)];
_topView = [[QXSystemTopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 74*2+8)];
_topView.delegate = self;
}
return _topView;

View File

@@ -67,6 +67,12 @@ NS_ASSUME_NONNULL_BEGIN
notice:(NSString*)notice
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
获取平台客服
*/
+(void)getSerbviceUserSuccessBlock:(void (^)(NSString * user_id , NSString * user_name))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@end
NS_ASSUME_NONNULL_END

View File

@@ -112,4 +112,18 @@
failBlock(error,msg);
}];
}
+(void)getSerbviceUserSuccessBlock:(void (^)(NSString * user_id , NSString * user_name))successBlock failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXRoomServicesUserId parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSString *user_id = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"user_id"]];
NSString *user_name = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"user_name"]];
successBlock(user_id,user_name);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
@end

View File

@@ -24,27 +24,17 @@
}
-(void)initSubviews{
MJWeakSelf
// self.noticeView = [[QXSystemTopSubView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 74)];
// self.noticeView.iconImageView.image = [UIImage imageNamed:@"notice_icon"];
// self.noticeView.titleLabel.text = QXText(@"官方公告");
// [self.noticeView addTapBlock:^(id _Nonnull obj) {
// if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickNoticeWithType:)]) {
// [weakSelf.delegate didClickNoticeWithType:0];
// }
// }];
// [self addSubview:self.noticeView];
self.noticeView = [[QXSystemTopSubView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 74)];
self.noticeView.iconImageView.image = [UIImage imageNamed:@"notice_icon"];
self.noticeView.titleLabel.text = QXText(@"官方公告");
[self.noticeView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickNoticeWithType:)]) {
[weakSelf.delegate didClickNoticeWithType:0];
}
}];
[self addSubview:self.noticeView];
// self.systemView = [[QXSystemTopSubView alloc] initWithFrame:CGRectMake(0, 74, SCREEN_WIDTH, 74)];
// self.systemView.iconImageView.image = [UIImage imageNamed:@"system_icon"];
// self.systemView.titleLabel.text = QXText(@"系统消息");
// [self addSubview:self.systemView];
// [self.systemView addTapBlock:^(id _Nonnull obj) {
// if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickNoticeWithType:)]) {
// [weakSelf.delegate didClickNoticeWithType:1];
// }
// }];
self.systemView = [[QXSystemTopSubView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 74)];
self.systemView = [[QXSystemTopSubView alloc] initWithFrame:CGRectMake(0, 74, SCREEN_WIDTH, 74)];
self.systemView.iconImageView.image = [UIImage imageNamed:@"system_icon"];
self.systemView.titleLabel.text = QXText(@"系统消息");
[self addSubview:self.systemView];
@@ -54,6 +44,16 @@
}
}];
// self.systemView = [[QXSystemTopSubView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 74)];
// self.systemView.iconImageView.image = [UIImage imageNamed:@"system_icon"];
// self.systemView.titleLabel.text = QXText(@"系统消息");
// [self addSubview:self.systemView];
// [self.systemView addTapBlock:^(id _Nonnull obj) {
// if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickNoticeWithType:)]) {
// [weakSelf.delegate didClickNoticeWithType:1];
// }
// }];
self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, self.systemView.bottom, SCREEN_WIDTH, 8)];
// self.bottomView.backgroundColor = RGB16(0xececec);
self.bottomView.backgroundColor = [UIColor clearColor];