上麦 下麦 麦位刷新
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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];
|
||||
|
@@ -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 {
|
||||
|
@@ -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]];
|
||||
|
@@ -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
|
||||
///开始展示声波动画
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user