修改了用户卡片踢人权限的问题
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
[self.functionArray addObject:self.giftItem];
|
||||
[self.functionArray addObject:self.chatItem];
|
||||
[self.functionArray addObject:self.attentionItem];
|
||||
///改变一下关注的状态
|
||||
///获取一下关注的状态
|
||||
[self userAttentionStatus:uid targetUid:targetUid];
|
||||
@weakify(self);
|
||||
[[self rac_queryChatRoomMember:uid roomId:roomId] subscribeNext:^(id _Nullable x) {
|
||||
@@ -101,11 +101,11 @@
|
||||
[[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) {
|
||||
NIMChatroomMember * targetMember = x;
|
||||
if (targetMember == nil) {return;}
|
||||
if (targetMember.type != NIMChatroomMemberTypeManager || targetMember.type != NIMChatroomMemberTypeCreator) { ///目标是管理员
|
||||
[self.functionArray addObject:self.kikoutItem];
|
||||
[self.functionArray addObject:self.blackItem];
|
||||
if (targetMember.type == NIMChatroomMemberTypeManager || targetMember.type == NIMChatroomMemberTypeCreator) { ///目标是管理员
|
||||
[[self getView] onGetFunctionArraySccess:self.functionArray];
|
||||
} else {
|
||||
[self.functionArray addObject:self.kikoutItem];
|
||||
[self.functionArray addObject:self.blackItem];
|
||||
[[self getView] onGetFunctionArraySccess:self.functionArray];
|
||||
}
|
||||
}];
|
||||
@@ -176,8 +176,12 @@
|
||||
} else {
|
||||
[array addObject:upDownItem];
|
||||
}
|
||||
[[self getView] onGetMicroFunctionArraySccess:array];
|
||||
} else {
|
||||
if (userInfo.position.length > 0) {
|
||||
[array addObject:upDownItem];
|
||||
}
|
||||
}
|
||||
[[self getView] onGetMicroFunctionArraySccess:array];
|
||||
}];
|
||||
} else {///不是自己看自己
|
||||
@weakify(self);
|
||||
|
@@ -30,7 +30,8 @@
|
||||
#import "XPUserCardProtocol.h"
|
||||
///VC
|
||||
#import "XPWebViewController.h"
|
||||
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "SessionViewController.h"
|
||||
|
||||
@interface XPUserCardViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,XPUserCardProtocol>
|
||||
///上面点击的view
|
||||
@@ -367,7 +368,9 @@
|
||||
}
|
||||
|
||||
- (void)onGetFunctionArraySccess:(NSArray<XPUserCardItemModel *> *)array {
|
||||
if (array.count <= 0) {return;}
|
||||
self.datasource = array;
|
||||
self.collectionView.hidden = NO;
|
||||
[self.collectionView reloadData];
|
||||
[self updateCollectionHeight:self.datasource];
|
||||
}
|
||||
@@ -376,6 +379,7 @@
|
||||
if (array.count <= 0) {return;}
|
||||
self.microItems = array;
|
||||
self.operaStackView.hidden = NO;
|
||||
self.sepLineView.hidden = NO;
|
||||
for (XPUserCardMicroItemModel * model in array) {
|
||||
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[button setTitle:model.title forState:UIControlStateNormal];
|
||||
@@ -461,7 +465,12 @@
|
||||
NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId];
|
||||
switch (model.type) {
|
||||
case UserCardItemType_Chat:
|
||||
///TODO : 去私聊
|
||||
{
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
NIMSession * session = [NIMSession session:self.cardInfo.uid type:NIMSessionTypeP2P];
|
||||
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
||||
[((UINavigationController *)self.presentingViewController) pushViewController:sessionVC animated:YES];
|
||||
}
|
||||
break;
|
||||
case UserCardItemType_Gift:
|
||||
{
|
||||
@@ -590,7 +599,10 @@
|
||||
}
|
||||
|
||||
- (void)gotoUserInfoVC:(UITapGestureRecognizer *)tap {
|
||||
NSLog(@"点击了私聊");
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
|
||||
userInfoVC.uid = self.cardInfo.uid.integerValue;
|
||||
[((UINavigationController *)self.presentingViewController) pushViewController:userInfoVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -817,6 +829,7 @@
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.hidden = YES;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[XPUserCardItemCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPUserCardItemCollectionViewCell class])];
|
||||
}
|
||||
@@ -827,6 +840,7 @@
|
||||
if (!_sepLineView) {
|
||||
_sepLineView = [[UIView alloc] init];
|
||||
_sepLineView.backgroundColor = [ThemeColor userDividerColor];
|
||||
_sepLineView.hidden = YES;
|
||||
}
|
||||
return _sepLineView;
|
||||
}
|
||||
|
Reference in New Issue
Block a user