房间内私聊

This commit is contained in:
fengshuo
2022-05-29 19:07:08 +08:00
parent ba5bcb4242
commit 7b097735c6
28 changed files with 588 additions and 37 deletions

View File

@@ -431,6 +431,9 @@
E84BF7DA277C72AC00EF8877 /* XPRoomRoleTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E84BF7D9277C72AC00EF8877 /* XPRoomRoleTableViewCell.m */; }; E84BF7DA277C72AC00EF8877 /* XPRoomRoleTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E84BF7D9277C72AC00EF8877 /* XPRoomRoleTableViewCell.m */; };
E84BF7DD277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E84BF7DC277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m */; }; E84BF7DD277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E84BF7DC277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m */; };
E84BF7E0277C869A00EF8877 /* XPRoomOnLineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E84BF7DF277C869A00EF8877 /* XPRoomOnLineViewController.m */; }; E84BF7E0277C869A00EF8877 /* XPRoomOnLineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E84BF7DF277C869A00EF8877 /* XPRoomOnLineViewController.m */; };
E84CBCE128436D3C00D43221 /* XPMineContactViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E84CBCE028436D3C00D43221 /* XPMineContactViewController.m */; };
E84CBCE4284372D800D43221 /* XPRoomHalfMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = E84CBCE3284372D800D43221 /* XPRoomHalfMessageView.m */; };
E84CBCE72843807500D43221 /* XPMineFriendPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E84CBCE62843807400D43221 /* XPMineFriendPresenter.m */; };
E851E45827FF024B002F3ACB /* XPMineGuildSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E851E45727FF024B002F3ACB /* XPMineGuildSearchViewController.m */; }; E851E45827FF024B002F3ACB /* XPMineGuildSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E851E45727FF024B002F3ACB /* XPMineGuildSearchViewController.m */; };
E851E45B27FF02DF002F3ACB /* XPGuildSearchPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E851E45A27FF02DF002F3ACB /* XPGuildSearchPresenter.m */; }; E851E45B27FF02DF002F3ACB /* XPGuildSearchPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E851E45A27FF02DF002F3ACB /* XPGuildSearchPresenter.m */; };
E851E45F27FF0FEB002F3ACB /* XPGuildSearchNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = E851E45E27FF0FEB002F3ACB /* XPGuildSearchNavView.m */; }; E851E45F27FF0FEB002F3ACB /* XPGuildSearchNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = E851E45E27FF0FEB002F3ACB /* XPGuildSearchNavView.m */; };
@@ -1685,6 +1688,13 @@
E84BF7DC277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRoleEmptyTableViewCell.m; sourceTree = "<group>"; }; E84BF7DC277C765400EF8877 /* XPRoomRoleEmptyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRoleEmptyTableViewCell.m; sourceTree = "<group>"; };
E84BF7DE277C869A00EF8877 /* XPRoomOnLineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomOnLineViewController.h; sourceTree = "<group>"; }; E84BF7DE277C869A00EF8877 /* XPRoomOnLineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomOnLineViewController.h; sourceTree = "<group>"; };
E84BF7DF277C869A00EF8877 /* XPRoomOnLineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomOnLineViewController.m; sourceTree = "<group>"; }; E84BF7DF277C869A00EF8877 /* XPRoomOnLineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomOnLineViewController.m; sourceTree = "<group>"; };
E84CBCDF28436D3C00D43221 /* XPMineContactViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineContactViewController.h; sourceTree = "<group>"; };
E84CBCE028436D3C00D43221 /* XPMineContactViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineContactViewController.m; sourceTree = "<group>"; };
E84CBCE2284372D800D43221 /* XPRoomHalfMessageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomHalfMessageView.h; sourceTree = "<group>"; };
E84CBCE3284372D800D43221 /* XPRoomHalfMessageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomHalfMessageView.m; sourceTree = "<group>"; };
E84CBCE52843807400D43221 /* XPMineFriendPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineFriendPresenter.h; sourceTree = "<group>"; };
E84CBCE62843807400D43221 /* XPMineFriendPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineFriendPresenter.m; sourceTree = "<group>"; };
E84CBCE8284380B300D43221 /* XPMineFriendProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineFriendProtocol.h; sourceTree = "<group>"; };
E851E45627FF024B002F3ACB /* XPMineGuildSearchViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineGuildSearchViewController.h; sourceTree = "<group>"; }; E851E45627FF024B002F3ACB /* XPMineGuildSearchViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineGuildSearchViewController.h; sourceTree = "<group>"; };
E851E45727FF024B002F3ACB /* XPMineGuildSearchViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineGuildSearchViewController.m; sourceTree = "<group>"; }; E851E45727FF024B002F3ACB /* XPMineGuildSearchViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineGuildSearchViewController.m; sourceTree = "<group>"; };
E851E45927FF02DF002F3ACB /* XPGuildSearchPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGuildSearchPresenter.h; sourceTree = "<group>"; }; E851E45927FF02DF002F3ACB /* XPGuildSearchPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGuildSearchPresenter.h; sourceTree = "<group>"; };
@@ -5321,6 +5331,10 @@
E896EF9E2771AE7B00AD2CC1 /* XPMineAttentionViewController.m */, E896EF9E2771AE7B00AD2CC1 /* XPMineAttentionViewController.m */,
E896EFA02771AE9400AD2CC1 /* XPMineFriendViewController.h */, E896EFA02771AE9400AD2CC1 /* XPMineFriendViewController.h */,
E896EFA12771AE9400AD2CC1 /* XPMineFriendViewController.m */, E896EFA12771AE9400AD2CC1 /* XPMineFriendViewController.m */,
E84CBCDF28436D3C00D43221 /* XPMineContactViewController.h */,
E84CBCE028436D3C00D43221 /* XPMineContactViewController.m */,
E84CBCE2284372D800D43221 /* XPRoomHalfMessageView.h */,
E84CBCE3284372D800D43221 /* XPRoomHalfMessageView.m */,
); );
path = Friend; path = Friend;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -6430,6 +6444,8 @@
E896EF932771AAC100AD2CC1 /* XPMineFansPresenter.m */, E896EF932771AAC100AD2CC1 /* XPMineFansPresenter.m */,
E896EF952771AAE400AD2CC1 /* XPMineAttentionPresenter.h */, E896EF952771AAE400AD2CC1 /* XPMineAttentionPresenter.h */,
E896EF962771AAE400AD2CC1 /* XPMineAttentionPresenter.m */, E896EF962771AAE400AD2CC1 /* XPMineAttentionPresenter.m */,
E84CBCE52843807400D43221 /* XPMineFriendPresenter.h */,
E84CBCE62843807400D43221 /* XPMineFriendPresenter.m */,
9BD9A17727A0EC57004186FE /* XPMineVisitorPresenter.h */, 9BD9A17727A0EC57004186FE /* XPMineVisitorPresenter.h */,
9BD9A17827A0EC57004186FE /* XPMineVisitorPresenter.m */, 9BD9A17827A0EC57004186FE /* XPMineVisitorPresenter.m */,
9B1B729628002147003FACE9 /* XPMineFansTeamPresenter.h */, 9B1B729628002147003FACE9 /* XPMineFansTeamPresenter.h */,
@@ -6462,6 +6478,7 @@
E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */, E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */,
E896EF982771AB0000AD2CC1 /* XPMineFansProtocol.h */, E896EF982771AB0000AD2CC1 /* XPMineFansProtocol.h */,
E896EF992771AB1800AD2CC1 /* XPMineAttentionProtocol.h */, E896EF992771AB1800AD2CC1 /* XPMineAttentionProtocol.h */,
E84CBCE8284380B300D43221 /* XPMineFriendProtocol.h */,
9BD9A17627A0E953004186FE /* XPMineVisitorProtocol.h */, 9BD9A17627A0E953004186FE /* XPMineVisitorProtocol.h */,
9B1B7299280021E7003FACE9 /* XPMineAnchorFansTeamProtocol.h */, 9B1B7299280021E7003FACE9 /* XPMineAnchorFansTeamProtocol.h */,
); );
@@ -6888,6 +6905,7 @@
E80B0737280D790400A79F63 /* GuildMessageModel.m in Sources */, E80B0737280D790400A79F63 /* GuildMessageModel.m in Sources */,
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */, E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */,
E88C72A6282921D60047FB2B /* XPRoomBackMusicPlayerView.m in Sources */, E88C72A6282921D60047FB2B /* XPRoomBackMusicPlayerView.m in Sources */,
E84CBCE72843807500D43221 /* XPMineFriendPresenter.m in Sources */,
E82D5C7D276B343300858D6D /* YYAnimatedImageView+ImageShow.m in Sources */, E82D5C7D276B343300858D6D /* YYAnimatedImageView+ImageShow.m in Sources */,
E851E45F27FF0FEB002F3ACB /* XPGuildSearchNavView.m in Sources */, E851E45F27FF0FEB002F3ACB /* XPGuildSearchNavView.m in Sources */,
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */, E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */,
@@ -6929,6 +6947,7 @@
E8E20BE2281695800033B688 /* XPMineLoginPasswordViewController.m in Sources */, E8E20BE2281695800033B688 /* XPMineLoginPasswordViewController.m in Sources */,
E824543826F5820A00BE8163 /* XPLoginVerifBindPhonePresenter.m in Sources */, E824543826F5820A00BE8163 /* XPLoginVerifBindPhonePresenter.m in Sources */,
E8B846BF26FD827900A777FE /* XPMineUserInfoAlbumViewController.m in Sources */, E8B846BF26FD827900A777FE /* XPMineUserInfoAlbumViewController.m in Sources */,
E84CBCE128436D3C00D43221 /* XPMineContactViewController.m in Sources */,
E8D48253278D8228003C1D08 /* AcrossRoomPKPanelModel.m in Sources */, E8D48253278D8228003C1D08 /* AcrossRoomPKPanelModel.m in Sources */,
E824545C26F5EEBA00BE8163 /* XPMineVerifIdentityPresenter.m in Sources */, E824545C26F5EEBA00BE8163 /* XPMineVerifIdentityPresenter.m in Sources */,
9B92A3562798096000AD168F /* XPSkillCardPresenter.m in Sources */, 9B92A3562798096000AD168F /* XPSkillCardPresenter.m in Sources */,
@@ -7088,6 +7107,7 @@
E8D34D6028082BA5009C4835 /* XPMineUserDataPresenter.m in Sources */, E8D34D6028082BA5009C4835 /* XPMineUserDataPresenter.m in Sources */,
9B16A34B27E1915A00E13A98 /* XPTrumpetPresenter.m in Sources */, 9B16A34B27E1915A00E13A98 /* XPTrumpetPresenter.m in Sources */,
E8A6C29827CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m in Sources */, E8A6C29827CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m in Sources */,
E84CBCE4284372D800D43221 /* XPRoomHalfMessageView.m in Sources */,
E8C1672D2806BD8B00ECB15C /* XPGuildSuperAdminRoomCollectionViewCell.m in Sources */, E8C1672D2806BD8B00ECB15C /* XPGuildSuperAdminRoomCollectionViewCell.m in Sources */,
E8EEB8F226FC2050007C6EBA /* SDPhotoBrowser.m in Sources */, E8EEB8F226FC2050007C6EBA /* SDPhotoBrowser.m in Sources */,
E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */, E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */,

View File

@@ -26,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign) BOOL isLike; @property (nonatomic,assign) BOOL isLike;
///代理 ///代理
@property (nonatomic,weak) id<SessionNavViewDelegate> delegate; @property (nonatomic,weak) id<SessionNavViewDelegate> delegate;
///是否在房间中
@property (nonatomic,assign) BOOL isInRoom;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -134,6 +134,11 @@
self.likeButton.hidden = _isLike; self.likeButton.hidden = _isLike;
} }
- (void)setIsInRoom:(BOOL)isInRoom {
_isInRoom = isInRoom;
self.reportButton.hidden = _isInRoom;
}
- (UIButton *)backButton { - (UIButton *)backButton {
if (!_backButton) { if (!_backButton) {
_backButton = [UIButton buttonWithType:UIButtonTypeCustom]; _backButton = [UIButton buttonWithType:UIButtonTypeCustom];

View File

@@ -6,6 +6,7 @@
// //
#import "MvpViewController.h" #import "MvpViewController.h"
#import "SessionListViewController.h"
#import <NIMSDK/NIMSDK.h> #import <NIMSDK/NIMSDK.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@@ -13,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SessionViewController : MvpViewController @interface SessionViewController : MvpViewController
- (instancetype)initWithSession:(NIMSession *)session; - (instancetype)initWithSession:(NIMSession *)session;
@property (nonatomic, assign) SessionListOpenType openType;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -132,6 +132,7 @@
#pragma mark - Private Method #pragma mark - Private Method
- (void)initViews { - (void)initViews {
self.sessionNavView.isInRoom = self.openType == SessionListOpenTypeRoom;
[self.view addSubview:self.sessionNavView]; [self.view addSubview:self.sessionNavView];
[self.view addSubview:self.followInRoomView]; [self.view addSubview:self.followInRoomView];
[self.view addSubview:self.sessionTableView]; [self.view addSubview:self.sessionTableView];

View File

@@ -8,7 +8,7 @@
// //
#import "BaseViewController.h" #import "BaseViewController.h"
#import <JXCategoryView/JXCategoryListContainerView.h>
#import <NIMSDK/NIMSDK.h> #import <NIMSDK/NIMSDK.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@@ -18,7 +18,7 @@ typedef NS_ENUM(NSUInteger, SessionListOpenType) {
SessionListOpenTypeRoom = 2, SessionListOpenTypeRoom = 2,
}; };
@interface SessionListViewController : BaseViewController @interface SessionListViewController : BaseViewController<JXCategoryListContentViewDelegate>
- (instancetype)initWithType:(SessionListOpenType)type; - (instancetype)initWithType:(SessionListOpenType)type;

View File

@@ -41,7 +41,7 @@
} }
- (BOOL)isHiddenNavBar { - (BOOL)isHiddenNavBar {
return self.openType == SessionListOpenTypeDefault; return YES;
} }
- (instancetype)initWithType:(SessionListOpenType)type { - (instancetype)initWithType:(SessionListOpenType)type {
@@ -73,7 +73,7 @@
- (void)initViews { - (void)initViews {
self.title = @"消息"; self.title = @"消息";
if ([self isHiddenNavBar]) { if (self.openType == SessionListOpenTypeDefault) {
[self.customNavigationBar addSubview:self.titleLabel]; [self.customNavigationBar addSubview:self.titleLabel];
[self.view addSubview:self.customNavigationBar]; [self.view addSubview:self.customNavigationBar];
} }
@@ -81,7 +81,7 @@
} }
- (void)initLayout { - (void)initLayout {
if ([self isHiddenNavBar]) { if (self.openType == SessionListOpenTypeDefault) {
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.customNavigationBar); make.center.mas_equalTo(self.customNavigationBar);
}]; }];
@@ -89,7 +89,7 @@
[self.sessionListView mas_makeConstraints:^(MASConstraintMaker *make) { [self.sessionListView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self.view); make.left.right.bottom.mas_equalTo(self.view);
if ([self isHiddenNavBar]) { if (self.openType == SessionListOpenTypeDefault) {
make.top.mas_equalTo(self.customNavigationBar.mas_bottom); make.top.mas_equalTo(self.customNavigationBar.mas_bottom);
} else { } else {
make.top.mas_equalTo(self.view); make.top.mas_equalTo(self.view);
@@ -126,6 +126,7 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
NIMRecentSession *recentSession = self.recentSessions[indexPath.row]; NIMRecentSession *recentSession = self.recentSessions[indexPath.row];
SessionViewController *vc = [[SessionViewController alloc] initWithSession:recentSession.session]; SessionViewController *vc = [[SessionViewController alloc] initWithSession:recentSession.session];
vc.openType = self.openType;
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
@@ -223,6 +224,11 @@
} }
} }
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
}
#pragma mark - Private #pragma mark - Private
- (NSInteger)findInsertPlace:(NIMRecentSession *)recentSession{ - (NSInteger)findInsertPlace:(NIMRecentSession *)recentSession{
__block NSUInteger matchIdx = 0; __block NSUInteger matchIdx = 0;

View File

@@ -34,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *userInRoomUid; @property (nonatomic,copy) NSString *userInRoomUid;
///贵族信息 ///贵族信息
@property (nonatomic, strong) UserVipInfoVo *userVipInfoVO; @property (nonatomic, strong) UserVipInfoVo *userVipInfoVO;
///是否在房间中 本地字段
@property (nonatomic,assign) BOOL isInRoom;
@end @end

View File

@@ -0,0 +1,16 @@
//
// XPMineFriendPresenter.h
// xplan-ios
//
// Created by 冯硕 on 2022/5/29.
//
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPMineFriendPresenter : BaseMvpPresenter
- (void)getUserListInfo:(NSArray *)array;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// XPMineFriendPresenter.m
// xplan-ios
//
// Created by on 2022/5/29.
//
#import "XPMineFriendPresenter.h"
#import "Api+Mine.h"
#import "XPMineFriendProtocol.h"
#import "UserInfoModel.h"
@implementation XPMineFriendPresenter
- (void)getUserListInfo:(NSArray *)array {
NSString * uids = @"";
if (array.count > 0) {
uids = [array componentsJoinedByString:@","];
}
[Api getUsersListInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *users= [UserInfoModel modelsWithArray:data.data];
[[self getView] getUserListInfoSuccess:users];
}] uids:uids];
}
@end

View File

@@ -0,0 +1,16 @@
//
// XPMineFriendProtocol.h
// xplan-ios
//
// Created by 冯硕 on 2022/5/29.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol XPMineFriendProtocol <NSObject>
- (void)getUserListInfoSuccess:(NSArray *)list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -123,7 +123,7 @@
} }
self.sexImageView.image = [UIImage imageNamed:sexStr]; self.sexImageView.image = [UIImage imageNamed:sexStr];
self.signLabel.text = _fansInfo.userDesc && _fansInfo.userDesc.length > 0? _fansInfo.userDesc : @"这个人很懒还没有签名"; self.signLabel.text = _fansInfo.userDesc && _fansInfo.userDesc.length > 0? _fansInfo.userDesc : @"这个人很懒还没有签名";
self.findButton.hidden = !_fansInfo.userInRoomUid; self.findButton.hidden = _fansInfo.userInRoomUid.length <= 0 || _fansInfo.isInRoom;
UIImage* image = self.experImageView.image; UIImage* image = self.experImageView.image;
if (image) { if (image) {
CGFloat scale = image.size.width / image.size.height; CGFloat scale = image.size.width / image.size.height;

View File

@@ -17,7 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPMineFansTableViewCell : UITableViewCell @interface XPMineFansTableViewCell : UITableViewCell
///粉丝信息 ///粉丝信息
@property (nonatomic,strong) FansInfoModel *fansInfo; @property (nonatomic,strong) FansInfoModel *fansInfo;
///是否在房间中
@property (nonatomic,assign) BOOL isInRoom;
///代理 ///代理
@property (nonatomic,weak) id<XPMineFansTableViewCellDelegate> delegate; @property (nonatomic,weak) id<XPMineFansTableViewCellDelegate> delegate;

View File

@@ -127,7 +127,7 @@
BOOL isMyFriend = [[NIMSDK sharedSDK].userManager isMyFriend:_fansInfo.uid]; BOOL isMyFriend = [[NIMSDK sharedSDK].userManager isMyFriend:_fansInfo.uid];
self.attentionButton.enabled = !isMyFriend; self.attentionButton.enabled = !isMyFriend;
self.attentionButton.hidden = _fansInfo.isInRoom;
UIImage* image = self.experImageView.image; UIImage* image = self.experImageView.image;
if (image) { if (image) {
CGFloat scale = image.size.width / image.size.height; CGFloat scale = image.size.width / image.size.height;

View File

@@ -39,7 +39,7 @@
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.contentView); make.centerX.mas_equalTo(self.contentView);
make.top.mas_equalTo(self.contentView).offset(250); make.bottom.mas_equalTo(self.contentView.mas_centerY).offset(-15);
make.size.mas_equalTo(CGSizeMake(100, 100)); make.size.mas_equalTo(CGSizeMake(100, 100));
}]; }];
@@ -49,6 +49,7 @@
}]; }];
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
- (void)setEmptyTitle:(NSString *)emptyTitle { - (void)setEmptyTitle:(NSString *)emptyTitle {
_emptyTitle = emptyTitle; _emptyTitle = emptyTitle;
if (_emptyTitle.length > 0) { if (_emptyTitle.length > 0) {

View File

@@ -8,8 +8,10 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@class UserInfoModel;
@interface XPMineFriendTableViewCell : UITableViewCell @interface XPMineFriendTableViewCell : UITableViewCell
@property (nonatomic,strong) UserInfoModel *userInfo;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -13,6 +13,8 @@
#import "NetImageView.h" #import "NetImageView.h"
#import "ThemeColor.h" #import "ThemeColor.h"
#import "UIImage+Utils.h" #import "UIImage+Utils.h"
///Model
#import "UserInfoModel.h"
@interface XPMineFriendTableViewCell () @interface XPMineFriendTableViewCell ()
/// ///
@@ -29,6 +31,8 @@
@property (nonatomic,strong) NetImageView *charmImageView; @property (nonatomic,strong) NetImageView *charmImageView;
/// ///
@property (nonatomic,strong) UILabel *signLabel; @property (nonatomic,strong) UILabel *signLabel;
///线
@property (nonatomic,strong) UIView *lineView;
@end @end
@@ -48,6 +52,12 @@
[self.contentView addSubview:self.avatarImageView]; [self.contentView addSubview:self.avatarImageView];
[self.contentView addSubview:self.stackView]; [self.contentView addSubview:self.stackView];
[self.contentView addSubview:self.signLabel]; [self.contentView addSubview:self.signLabel];
[self.contentView addSubview:self.lineView];
[self.stackView addArrangedSubview:self.nickLabel];
[self.stackView addArrangedSubview:self.sexImageView];
[self.stackView addArrangedSubview:self.experImageView];
[self.stackView addArrangedSubview:self.charmImageView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
@@ -66,9 +76,63 @@
make.left.mas_equalTo(self.stackView); make.left.mas_equalTo(self.stackView);
make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(2); make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(2);
}]; }];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.stackView);
make.bottom.mas_equalTo(self.contentView);
make.height.mas_equalTo(1);
make.right.mas_equalTo(self.contentView).offset(-15);
}];
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
- (void)setUserInfo:(UserInfoModel *)userInfo {
_userInfo = userInfo;
if (_userInfo) {
self.avatarImageView.imageUrl = _userInfo.avatar;
self.experImageView.imageUrl = _userInfo.userLevelVo.experUrl;
self.charmImageView.imageUrl = _userInfo.userLevelVo.charmUrl;
self.nickLabel.text = _userInfo.nick;
NSString *sexStr;
if (_userInfo.gender == GenderType_Male) {
sexStr = @"common_male";
} else {
sexStr = @"common_female";
}
self.sexImageView.image = [UIImage imageNamed:sexStr];
self.signLabel.text = _userInfo.userDesc && _userInfo.userDesc.length > 0? _userInfo.userDesc : @"这个人很懒还没有签名";
UIImage* image = self.experImageView.image;
if (image) {
CGFloat scale = image.size.width / image.size.height;
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
} else {
NSURL *imgUrl = [NSURL URLWithString:_userInfo.userLevelVo.experUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
}
UIImage* charmImage = self.charmImageView.image;
if (charmImage) {
CGFloat scale = charmImage.size.width / charmImage.size.height;
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
} else {
NSURL *imgUrl = [NSURL URLWithString:_userInfo.userLevelVo.charmUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
}
}
}
- (NetImageView *)avatarImageView { - (NetImageView *)avatarImageView {
if (!_avatarImageView) { if (!_avatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init]; NetImageConfig * config = [[NetImageConfig alloc]init];
@@ -135,4 +199,12 @@
} }
return _signLabel; return _signLabel;
} }
- (UIView *)lineView {
if (!_lineView) {
_lineView = [[UIView alloc] init];
_lineView.backgroundColor = [ThemeColor dividerColor];
}
return _lineView;
}
@end @end

View File

@@ -6,11 +6,12 @@
// //
#import "MvpViewController.h" #import "MvpViewController.h"
#import <JXCategoryView/JXCategoryListContainerView.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface XPMineAttentionViewController : MvpViewController @interface XPMineAttentionViewController : MvpViewController<JXCategoryListContentViewDelegate>
//是否在房间内
@property (nonatomic,assign) BOOL isInRoom;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -11,6 +11,7 @@
#import <MJRefresh/MJRefresh.h> #import <MJRefresh/MJRefresh.h>
///Tool ///Tool
#import "ThemeColor.h" #import "ThemeColor.h"
#import "XPMacro.h"
///Model ///Model
#import "FansInfoModel.h" #import "FansInfoModel.h"
///View ///View
@@ -26,6 +27,7 @@
///VC ///VC
#import "XPMineUserInfoViewController.h" #import "XPMineUserInfoViewController.h"
#import "XPRoomViewController.h" #import "XPRoomViewController.h"
#import "SessionViewController.h"
@interface XPMineAttentionViewController ()<UITableViewDelegate,UITableViewDataSource, XPMineAttentionProtocol, XPMineAttentionTableViewCellDelegate> @interface XPMineAttentionViewController ()<UITableViewDelegate,UITableViewDataSource, XPMineAttentionProtocol, XPMineAttentionTableViewCellDelegate>
/// ///
@@ -40,6 +42,10 @@
@implementation XPMineAttentionViewController @implementation XPMineAttentionViewController
- (BOOL)isHiddenNavBar {
return self.isInRoom ? YES : NO;
}
- (XPMineAttentionPresenter *)createPresenter { - (XPMineAttentionPresenter *)createPresenter {
return [[XPMineAttentionPresenter alloc] init]; return [[XPMineAttentionPresenter alloc] init];
} }
@@ -125,6 +131,10 @@
return self.datasource.count > 0 ? self.datasource.count : 1; return self.datasource.count > 0 ? self.datasource.count : 1;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return self.datasource.count > 0 ? 65 : self.isInRoom ? (KScreenHeight - kNavigationHeight) : (KScreenHeight - 200 - kNavigationHeight);
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) { if (self.datasource.count > 0) {
XPMineAttentionTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineAttentionTableViewCell class])]; XPMineAttentionTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineAttentionTableViewCell class])];
@@ -132,7 +142,9 @@
cell = [[XPMineAttentionTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineAttentionTableViewCell class])]; cell = [[XPMineAttentionTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineAttentionTableViewCell class])];
} }
cell.delegate = self; cell.delegate = self;
cell.fansInfo = [self.datasource objectAtIndex:indexPath.row]; FansInfoModel * fansInfo = [self.datasource objectAtIndex:indexPath.row];
fansInfo.isInRoom = self.isInRoom;
cell.fansInfo = fansInfo;
return cell; return cell;
} }
@@ -147,10 +159,18 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) { if (self.datasource.count > 0) {
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init]; if (self.isInRoom) {
FansInfoModel * fansInfoModel = [self.datasource objectAtIndex:indexPath.row]; FansInfoModel * fansInfoModel = [self.datasource objectAtIndex:indexPath.row];
userInfoVC.uid = fansInfoModel.uid.integerValue; SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:[NIMSession session:fansInfoModel.uid type:NIMSessionTypeP2P]];
[self.navigationController pushViewController:userInfoVC animated:YES]; sessionVC.openType = SessionListOpenTypeRoom;
[self.navigationController pushViewController:sessionVC animated:YES];
} else {
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
FansInfoModel * fansInfoModel = [self.datasource objectAtIndex:indexPath.row];
fansInfoModel.isInRoom = self.isInRoom;
userInfoVC.uid = fansInfoModel.uid.integerValue;
[self.navigationController pushViewController:userInfoVC animated:YES];
}
} }
} }
@@ -168,6 +188,11 @@
[XPRoomViewController openRoom:uid viewController:self]; [XPRoomViewController openRoom:uid viewController:self];
} }
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
}
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
- (UITableView *)tableView { - (UITableView *)tableView {

View File

@@ -0,0 +1,16 @@
//
// XPMineContactViewController.h
// xplan-ios
//
// Created by 冯硕 on 2022/5/29.
//
#import "BaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPMineContactViewController : BaseViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,160 @@
//
// XPMineContactViewController.m
// xplan-ios
//
// Created by on 2022/5/29.
//
#import "XPMineContactViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <JXCategoryView/JXCategoryView.h>
#import <JXCategoryView/JXCategoryListContainerView.h>
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
///View
#import "SessionListViewController.h"
#import "XPMineFriendViewController.h"
#import "XPMineAttentionViewController.h"
#import "XPMineFansViewController.h"
@interface XPMineContactViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
///
@property (nonatomic,strong) NSArray<NSString *> *titles;
///
@property (nonatomic,strong) JXCategoryTitleView *titleView;
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
///
@property (nonatomic,strong) SessionListViewController *sessionListVC;
///
@property (nonatomic,strong) XPMineFriendViewController *friendVC;
///
@property (nonatomic,strong) XPMineAttentionViewController *attentionVC;
///
@property (nonatomic,strong) XPMineFansViewController *fansVC;
@end
@implementation XPMineContactViewController
- (BOOL)isHiddenNavBar {
return YES;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
}
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.titleView];
[self.view addSubview:self.listContainerView];
}
- (void)initSubViewConstraints {
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self.view);
make.height.mas_equalTo(50);
}];
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(self.titleView.mas_bottom);
}];
}
#pragma mark - JXCategoryListContainerViewDelegate
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
return self.titles.count;
}
// index `JXCategoryListContentViewDelegate`
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
if (index == 0) {
return self.sessionListVC;
}else if (index == 1) {
return self.friendVC;
} else if(index == 2) {
return self.fansVC;
} else {
return self.attentionVC;
}
}
#pragma mark - Getters And Setters
- (JXCategoryListContainerView *)listContainerView {
if (!_listContainerView) {
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
_listContainerView.listCellBackgroundColor = [UIColor clearColor];
}
return _listContainerView;
}
- (NSArray<NSString *> *)titles {
if (!_titles) {
_titles = @[@"消息", @"好友",@"粉丝", @"关注"];
}
return _titles;
}
- (JXCategoryTitleView *)titleView {
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] initWithFrame:CGRectZero];
_titleView.backgroundColor =[UIColor clearColor];
_titleView.titleColor = UIColorFromRGB(0x444444);
_titleView.titleSelectedColor = [ThemeColor mainTextColor];
_titleView.titleFont = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_titleView.titleSelectedFont = [UIFont systemFontOfSize:18 weight:UIFontWeightHeavy];
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.averageCellSpacingEnabled = NO;
_titleView.defaultSelectedIndex = 0;
_titleView.titles = self.titles;
_titleView.delegate = self;
_titleView.cellSpacing = 0;
_titleView.cellWidth = (CGFloat)KScreenWidth/ 4.0;
_titleView.listContainer = self.listContainerView;
JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
lineView.indicatorColor = [ThemeColor appMainColor];
lineView.indicatorWidth = 8.f;
lineView.indicatorHeight = 4.f;
lineView.indicatorCornerRadius = 2.f;
_titleView.indicators = @[lineView];
}
return _titleView;
}
- (SessionListViewController *)sessionListVC {
if (!_sessionListVC) {
_sessionListVC = [[SessionListViewController alloc] initWithType:SessionListOpenTypeRoom];
}
return _sessionListVC;
}
- (XPMineAttentionViewController *)attentionVC {
if (!_attentionVC) {
_attentionVC = [[XPMineAttentionViewController alloc] init];
_attentionVC.isInRoom = YES;
}
return _attentionVC;
}
- (XPMineFriendViewController *)friendVC {
if (!_friendVC) {
_friendVC = [[XPMineFriendViewController alloc] init];
_friendVC.isInRoom = YES;
}
return _friendVC;
}
- (XPMineFansViewController *)fansVC {
if (!_fansVC) {
_fansVC = [[XPMineFansViewController alloc] init];
_fansVC.isInRoom = YES;
}
return _fansVC;
}
@end

View File

@@ -6,11 +6,12 @@
// //
#import "MvpViewController.h" #import "MvpViewController.h"
#import <JXCategoryView/JXCategoryListContainerView.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface XPMineFansViewController : MvpViewController @interface XPMineFansViewController : MvpViewController<JXCategoryListContentViewDelegate>
///是否在房间内
@property (nonatomic,assign) BOOL isInRoom;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -11,6 +11,7 @@
#import <MJRefresh/MJRefresh.h> #import <MJRefresh/MJRefresh.h>
///Tool ///Tool
#import "ThemeColor.h" #import "ThemeColor.h"
#import "XPMacro.h"
///Model ///Model
#import "FansInfoModel.h" #import "FansInfoModel.h"
///View ///View
@@ -21,6 +22,7 @@
#import "XPMineFansProtocol.h" #import "XPMineFansProtocol.h"
///VC ///VC
#import "XPMineUserInfoViewController.h" #import "XPMineUserInfoViewController.h"
#import "SessionViewController.h"
@interface XPMineFansViewController ()<UITableViewDelegate,UITableViewDataSource, XPMineFansProtocol, XPMineFansTableViewCellDelegate> @interface XPMineFansViewController ()<UITableViewDelegate,UITableViewDataSource, XPMineFansProtocol, XPMineFansTableViewCellDelegate>
/// ///
@@ -35,6 +37,10 @@
@implementation XPMineFansViewController @implementation XPMineFansViewController
- (BOOL)isHiddenNavBar {
return self.isInRoom ? YES : NO;
}
- (XPMineFansPresenter *)createPresenter { - (XPMineFansPresenter *)createPresenter {
return [[XPMineFansPresenter alloc] init]; return [[XPMineFansPresenter alloc] init];
} }
@@ -135,6 +141,10 @@
return self.datasource.count > 0 ? self.datasource.count : 1; return self.datasource.count > 0 ? self.datasource.count : 1;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return self.datasource.count > 0 ? 65 : self.isInRoom ? (KScreenHeight - kNavigationHeight) : (KScreenHeight - 200 - kNavigationHeight);
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) { if (self.datasource.count > 0) {
XPMineFansTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineFansTableViewCell class])]; XPMineFansTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineFansTableViewCell class])];
@@ -142,7 +152,9 @@
cell = [[XPMineFansTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineFansTableViewCell class])]; cell = [[XPMineFansTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineFansTableViewCell class])];
} }
cell.delegate = self; cell.delegate = self;
cell.fansInfo = [self.datasource objectAtIndex:indexPath.row]; FansInfoModel * fansInfo = [self.datasource objectAtIndex:indexPath.row];
fansInfo.isInRoom = self.isInRoom;
cell.fansInfo = fansInfo;
return cell; return cell;
} }
@@ -157,13 +169,25 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) { if (self.datasource.count > 0) {
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init]; if (self.isInRoom) {
FansInfoModel * fansInfoModel = [self.datasource objectAtIndex:indexPath.row]; FansInfoModel * fansInfoModel = [self.datasource objectAtIndex:indexPath.row];
userInfoVC.uid = fansInfoModel.uid.integerValue; SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:[NIMSession session:fansInfoModel.uid type:NIMSessionTypeP2P]];
[self.navigationController pushViewController:userInfoVC animated:YES]; sessionVC.openType = SessionListOpenTypeRoom;
[self.navigationController pushViewController:sessionVC animated:YES];
} else {
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
FansInfoModel * fansInfoModel = [self.datasource objectAtIndex:indexPath.row];
userInfoVC.uid = fansInfoModel.uid.integerValue;
[self.navigationController pushViewController:userInfoVC animated:YES];
}
} }
} }
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
}
#pragma mark - mark #pragma mark - mark
- (void)xPMineFansTableViewCell:(XPMineFansTableViewCell *)view didClickAttention:(NSString *)uid { - (void)xPMineFansTableViewCell:(XPMineFansTableViewCell *)view didClickAttention:(NSString *)uid {
if (uid.length > 0) { if (uid.length > 0) {

View File

@@ -5,12 +5,13 @@
// Created by 冯硕 on 2021/12/21. // Created by 冯硕 on 2021/12/21.
// //
#import "BaseViewController.h" #import "MvpViewController.h"
#import <JXCategoryView/JXCategoryListContainerView.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface XPMineFriendViewController : BaseViewController @interface XPMineFriendViewController : MvpViewController<JXCategoryListContentViewDelegate>
//是否在房间内
@property (nonatomic,assign) BOOL isInRoom;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -12,11 +12,18 @@
#import <NIMSDK/NIMSDK.h> #import <NIMSDK/NIMSDK.h>
///Tool ///Tool
#import "ThemeColor.h" #import "ThemeColor.h"
#import "XPMacro.h"
///Model
#import "UserInfoModel.h"
///View ///View
#import "XPMineFriendEmptyTableViewCell.h" #import "XPMineFriendEmptyTableViewCell.h"
#import "XPMineFriendTableViewCell.h" #import "XPMineFriendTableViewCell.h"
#import "SessionViewController.h"
///P
#import "XPMineFriendPresenter.h"
#import "XPMineFriendProtocol.h"
@interface XPMineFriendViewController ()<UITableViewDelegate,UITableViewDataSource> @interface XPMineFriendViewController ()<UITableViewDelegate,UITableViewDataSource, XPMineFriendProtocol>
/// ///
@property (nonatomic,strong) UITableView *tableView; @property (nonatomic,strong) UITableView *tableView;
/// ///
@@ -29,9 +36,23 @@
@implementation XPMineFriendViewController @implementation XPMineFriendViewController
- (__kindof id)createPresenter {
return [[XPMineFriendPresenter alloc] init];
}
- (BOOL)isHiddenNavBar {
return self.isInRoom ? YES : NO;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.datasource = [[NIMSDK sharedSDK].userManager myFriends]; NSArray * array = [[NIMSDK sharedSDK].userManager myFriends];
NSMutableArray * uids = [NSMutableArray array];
for (int i = 0; i< array.count; i++) {
NIMUser * user = [array objectAtIndex:i];
[uids addObject:user.userId];
}
[self.presenter getUserListInfo:uids];
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
} }
@@ -50,12 +71,18 @@
return self.datasource.count > 0 ? self.datasource.count : 1; return self.datasource.count > 0 ? self.datasource.count : 1;
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return self.datasource.count > 0 ? 65 : self.isInRoom ? (KScreenHeight - kNavigationHeight) : (KScreenHeight - 200 - kNavigationHeight);
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) { if (self.datasource.count > 0) {
XPMineFriendTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineFriendTableViewCell class])]; XPMineFriendTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineFriendTableViewCell class])];
if (cell == nil) { if (cell == nil) {
cell = [[XPMineFriendTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineFriendTableViewCell class])]; cell = [[XPMineFriendTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineFriendTableViewCell class])];
} }
cell.userInfo = [self.datasource objectAtIndex:indexPath.row];
return cell; return cell;
} }
@@ -69,6 +96,23 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
UserInfoModel * userInfo = [self.datasource objectAtIndex:indexPath.row];
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:[NIMSession session:[NSString stringWithFormat:@"%ld", userInfo.uid] type:NIMSessionTypeP2P]];
sessionVC.openType = SessionListOpenTypeRoom;
[self.navigationController pushViewController:sessionVC animated:YES];
}
}
#pragma mark - XPMineFriendProtocol
- (void)getUserListInfoSuccess:(NSArray *)list {
self.datasource = list;
[self.tableView reloadData];
}
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters

View File

@@ -0,0 +1,16 @@
//
// XPRoomHalfMessageView.h
// xplan-ios
//
// Created by 冯硕 on 2022/5/29.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPRoomHalfMessageView : UIView
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,73 @@
//
// XPRoomHalfMessageView.m
// xplan-ios
//
// Created by on 2022/5/29.
//
#import "XPRoomHalfMessageView.h"
///Third
#import <Masonry/Masonry.h>
#import "XPMacro.h"
#import "BaseNavigationController.h"
///View
#import "XPMineContactViewController.h"
@interface XPRoomHalfMessageView ()
///View
@property (nonatomic,strong) UIView *dismissView;
///
@property (nonatomic,strong) UIWindow *messageWindow;
@end
@implementation XPRoomHalfMessageView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.dismissView];
[self addSubview:self.messageWindow];
}
#pragma mark - Event Response
- (void)dismissViewTap {
[self removeFromSuperview];
self.messageWindow.rootViewController = nil;
self.messageWindow.windowLevel = -1;
self.messageWindow = nil;
}
#pragma mark - Getters And Setters
- (UIView *)dismissView {
if (!_dismissView) {
_dismissView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 200)];
_dismissView.backgroundColor = [UIColor clearColor];
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissViewTap)];
[_dismissView addGestureRecognizer:tap];
}
return _dismissView;
}
- (UIWindow *)messageWindow {
if (!_messageWindow) {
//vc
XPMineContactViewController * vc=[XPMineContactViewController new];
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:vc];
//window,window,windowLevelwindow
UIWindow *testWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 200, KScreenWidth, KScreenHeight - 200)];
testWindow.windowLevel = UIWindowLevelAlert;
testWindow.backgroundColor = UIColor.redColor;
testWindow.rootViewController = nav;
testWindow.hidden = NO;
_messageWindow = testWindow;
}
return _messageWindow;
}
@end

View File

@@ -15,6 +15,7 @@
#import "XCHudTool.h" #import "XCHudTool.h"
#import "StatisticsServiceHelper.h" #import "StatisticsServiceHelper.h"
#import "Themecolor.h" #import "Themecolor.h"
#import "XPMacro.h"
///Model ///Model
#import "XPRoomMenuItem.h" #import "XPRoomMenuItem.h"
#import "MicroQueueModel.h" #import "MicroQueueModel.h"
@@ -29,6 +30,7 @@
#import "XPRoomMoreMenuViewController.h" #import "XPRoomMoreMenuViewController.h"
#import "XPNobleCenterViewController.h" #import "XPNobleCenterViewController.h"
#import "XPRoomFaceViewController.h" #import "XPRoomFaceViewController.h"
#import "XPRoomHalfMessageView.h"
@interface XPRoomMenuContainerView () @interface XPRoomMenuContainerView ()
/// ///
@@ -55,6 +57,8 @@
@property (nonatomic,strong) UIButton *nobleButton; @property (nonatomic,strong) UIButton *nobleButton;
/// ///
@property (nonatomic,weak) id<RoomHostDelegate> delegate; @property (nonatomic,weak) id<RoomHostDelegate> delegate;
///
@property (nonatomic,strong) XPRoomHalfMessageView *halfMessageView;
@end @end
@@ -111,9 +115,17 @@
[self.delegate.getCurrentNav presentViewController:giftView animated:YES completion:nil]; [self.delegate.getCurrentNav presentViewController:giftView animated:YES completion:nil];
} }
break; break;
case XPRoomMenuItemType_Message: { case XPRoomMenuItemType_Message:
SessionListViewController * sessionList = [[SessionListViewController alloc] initWithType:SessionListOpenTypeRoom]; {
[self.delegate.getCurrentNav pushViewController:sessionList animated:YES]; XPRoomHalfMessageView *halfMessageView = [[XPRoomHalfMessageView alloc] init];
halfMessageView.frame = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight);
[[UIApplication sharedApplication].delegate.window addSubview:halfMessageView];
[UIView animateWithDuration:.35 animations:^{
CGRect rect = halfMessageView.frame;
rect.origin.y = 0;
halfMessageView.frame = rect;
}];
} }
break; break;
case XPRoomMenuItemType_More: { case XPRoomMenuItemType_More: {
@@ -487,4 +499,11 @@
return _scrollView; return _scrollView;
} }
- (XPRoomHalfMessageView *)halfMessageView {
if (!_halfMessageView) {
_halfMessageView = [[XPRoomHalfMessageView alloc] init];
}
return _halfMessageView;
}
@end @end