上麦 下麦 麦位刷新

This commit is contained in:
fengshuo
2021-10-22 16:39:06 +08:00
parent c21572ed05
commit c3e69d6885
8 changed files with 30 additions and 6 deletions

View File

@@ -30,6 +30,9 @@
@property (nonatomic,assign) BOOL isLoadingMic;
///
@property (nonatomic,strong) NSMutableArray *delegateArray;
///
@property (nonatomic,strong) UserInfoModel *userInfo;
@end
@implementation XPIMRoomMicQueueImpl
@@ -111,7 +114,7 @@
- (void)updateChatRoomQueue:(NSString *)position{
///TODO
UserInfoModel * userInfo;
UserInfoModel * userInfo = self.userInfo;
MicroQueueItemModel * model = [self findUserMicroModel:userInfo.uid];
if (model) {///
if (position.intValue != model.microState.position) {
@@ -268,6 +271,11 @@
}
}
#warning to do
- (void)setCurrentUserInfo:(UserInfoModel *)userInfo {
self.userInfo = userInfo;
}
#pragma mark - Getters And Setters
- (NSMutableDictionary<NSString *,MicroQueueItemModel *> *)queue {
if (!_queue) {

View File

@@ -10,7 +10,7 @@
#import <NIMSDK/NIMSDK.h>
#import "XPIMRoomMicQueueDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@class UserInfoModel;
@protocol XPIMRoomMicQueueInterface <NSObject>
///进入房间成功之后根据扩展字段整理麦序
@@ -36,6 +36,9 @@ NS_ASSUME_NONNULL_BEGIN
///移除代理
- (void)removeDelegate:(id<XPIMRoomMicQueueDelegate>)delegate;
///TODO 先这样用着 上麦需要用户信息
- (void)setCurrentUserInfo:(UserInfoModel *)userInfo;
@end
NS_ASSUME_NONNULL_END

View File

@@ -152,6 +152,9 @@
#pragma mark - XPIMRoomInterface
- (void)enterRoomWithRoomId:(NSString *)roomId userInfo:(UserInfoModel *)userInfo {
///TODO
[[XPIMManager shareManager].microQueueManager setCurrentUserInfo:userInfo];
NIMChatroomEnterRequest *request = [[NIMChatroomEnterRequest alloc] init];
request.roomId = roomId;

View File

@@ -132,7 +132,7 @@
{
#warning to do
XPRoomViewController * roomVC = [[XPRoomViewController alloc] init];
roomVC.roomUid = [NSString stringWithFormat:@"%ld",1004567];
roomVC.roomUid = [NSString stringWithFormat:@"%ld",self.userInfo.uid];
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:roomVC];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:nav animated:YES completion:nil];

View File

@@ -25,8 +25,7 @@
[[XPIMManager shareManager].microQueueManager downMic:postion];
}];
MicroQueueItemModel * micModel = [[XPIMManager shareManager].microQueueManager.microQueue objectForKey:[AccountInfoStorage instance].getUid];
MicroQueueItemModel * micModel = [[XPIMManager shareManager].microQueueManager.microQueue objectForKey:postion];
if (micModel.userInfo) {
[TTPopup actionSheetWithItems:@[downMic]];
} else {

View File

@@ -59,6 +59,7 @@
}
- (void)confiItemAvatarNick:(UserInfoModel *)userInfo {
self.nickLabel.text = @"号坑位";
if (userInfo) {
[self.avatarImageView load_imageWithUrl:userInfo.avatar placeholderImage:[UIImageConstant defaultAvatarPlaceholder]];
if (userInfo.gender == GenderType_Male) {
@@ -67,7 +68,7 @@
[self.postionLabel setBackgroundColor:[ThemeColor positionFemaleNickBackColor]];
}
if (userInfo.nick.length > 0) {
self.postionLabel.text = userInfo.nick;
self.nickLabel.text = userInfo.nick;
}
} else {
[self.postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]];

View File

@@ -30,6 +30,10 @@
return self;
}
- (void)layoutSubviews {
self.avatarImageView.layer.masksToBounds = YES;
self.avatarImageView.layer.cornerRadius = self.frame.size.width / 2;
}
#pragma mark - Public Method
///

View File

@@ -27,6 +27,8 @@
///Category
#import "XPRoomViewController+RoomInfoContainerView.h"
#import "XPIMManager.h"
@interface XPRoomViewController ()<XPRoomProtocol>
///
@property (nonatomic,strong) XPRoomBackContainerView *backContainerView;
@@ -121,6 +123,9 @@
#pragma mark - XPRoomProtocol
- (void)getRoomInfoSuccess:(RoomInfoModel *)roomInfo {
self.roomInfo = roomInfo;
///
[[XPIMManager shareManager].chatRoomManager setCurrentRoomInfo:roomInfo];
NSString * uid = [AccountInfoStorage instance].getUid;
if (roomInfo.valid) {
[self configRoomInfoContainerViewWithRoomInfo:roomInfo]; // S1
@@ -137,6 +142,7 @@
- (void)getUserInfoSuccess:(UserInfoModel *)userInfo {
self.usereInfo = userInfo;
// TODO:
[[XPIMManager shareManager].chatRoomManager enterRoomWithRoomId:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] userInfo:self.usereInfo];
}
- (void)openRoomSuccess:(RoomInfoModel *)roomInfo {