消息模块-所以设置添加了黑名-
This commit is contained in:
@@ -700,6 +700,8 @@
|
||||
E8E20BDE28164D3A0033B688 /* SessionNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BDD28164D3A0033B688 /* SessionNavView.m */; };
|
||||
E8E20BE2281695800033B688 /* XPMineLoginPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BE1281695800033B688 /* XPMineLoginPasswordViewController.m */; };
|
||||
E8E20BE828169BDC0033B688 /* XPMineLoginPasswordPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BE728169BDC0033B688 /* XPMineLoginPasswordPresenter.m */; };
|
||||
E8E20BEC2816A5B90033B688 /* XPMineBlackListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BEB2816A5B90033B688 /* XPMineBlackListViewController.m */; };
|
||||
E8E20BEF2816A5FC0033B688 /* XPMineBlackListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E20BEE2816A5FC0033B688 /* XPMineBlackListTableViewCell.m */; };
|
||||
E8E5E18B27C332EE00F457D8 /* XPHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E18A27C332EE00F457D8 /* XPHomeViewController.m */; };
|
||||
E8E5E18E27C3331E00F457D8 /* XPHomeRecommendViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E18D27C3331E00F457D8 /* XPHomeRecommendViewController.m */; };
|
||||
E8E5E19127C369F000F457D8 /* XPHomeRecommendListView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19027C369F000F457D8 /* XPHomeRecommendListView.m */; };
|
||||
@@ -2147,6 +2149,10 @@
|
||||
E8E20BE628169BDC0033B688 /* XPMineLoginPasswordPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineLoginPasswordPresenter.h; sourceTree = "<group>"; };
|
||||
E8E20BE728169BDC0033B688 /* XPMineLoginPasswordPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineLoginPasswordPresenter.m; sourceTree = "<group>"; };
|
||||
E8E20BE928169E410033B688 /* XPMineLoginPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineLoginPasswordProtocol.h; sourceTree = "<group>"; };
|
||||
E8E20BEA2816A5B90033B688 /* XPMineBlackListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineBlackListViewController.h; sourceTree = "<group>"; };
|
||||
E8E20BEB2816A5B90033B688 /* XPMineBlackListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineBlackListViewController.m; sourceTree = "<group>"; };
|
||||
E8E20BED2816A5FC0033B688 /* XPMineBlackListTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineBlackListTableViewCell.h; sourceTree = "<group>"; };
|
||||
E8E20BEE2816A5FC0033B688 /* XPMineBlackListTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineBlackListTableViewCell.m; sourceTree = "<group>"; };
|
||||
E8E5E18927C332EE00F457D8 /* XPHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeViewController.h; sourceTree = "<group>"; };
|
||||
E8E5E18A27C332EE00F457D8 /* XPHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeViewController.m; sourceTree = "<group>"; };
|
||||
E8E5E18C27C3331E00F457D8 /* XPHomeRecommendViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendViewController.h; sourceTree = "<group>"; };
|
||||
@@ -5851,6 +5857,8 @@
|
||||
E824546026F5F4E400BE8163 /* XPMineResetPayPwdViewController.m */,
|
||||
E8E20BE0281695800033B688 /* XPMineLoginPasswordViewController.h */,
|
||||
E8E20BE1281695800033B688 /* XPMineLoginPasswordViewController.m */,
|
||||
E8E20BEA2816A5B90033B688 /* XPMineBlackListViewController.h */,
|
||||
E8E20BEB2816A5B90033B688 /* XPMineBlackListViewController.m */,
|
||||
);
|
||||
path = Setting;
|
||||
sourceTree = "<group>";
|
||||
@@ -6045,6 +6053,8 @@
|
||||
E8AC723126F49710007D6E91 /* XPMineNotificationTableViewCell.m */,
|
||||
9B92A33A2797E38100AD168F /* XPMineHeadItemTableViewCell.h */,
|
||||
9B92A33B2797E38100AD168F /* XPMineHeadItemTableViewCell.m */,
|
||||
E8E20BED2816A5FC0033B688 /* XPMineBlackListTableViewCell.h */,
|
||||
E8E20BEE2816A5FC0033B688 /* XPMineBlackListTableViewCell.m */,
|
||||
);
|
||||
path = Cell;
|
||||
sourceTree = "<group>";
|
||||
@@ -6427,6 +6437,7 @@
|
||||
E880B3B2278C1D1800A83B0D /* XPAcrossRoomPKRuleView.m in Sources */,
|
||||
E81C1B262770663B0020D1E4 /* XPArrangeMicTableViewCell.m in Sources */,
|
||||
E81AF31A27F19265003B9E43 /* XPHomeGradientLabel.m in Sources */,
|
||||
E8E20BEC2816A5B90033B688 /* XPMineBlackListViewController.m in Sources */,
|
||||
E8AC722F26F49610007D6E91 /* XPMineNotificationItemModel.m in Sources */,
|
||||
9B1B72BC28003E06003FACE9 /* XPAnchorPKTableViewCell.m in Sources */,
|
||||
E8E70D7A26F2F16600F03460 /* XPMinePresent.m in Sources */,
|
||||
@@ -6661,6 +6672,7 @@
|
||||
9BB89DC627FEB9E100586A83 /* XPAnchorFansTaskViewController.m in Sources */,
|
||||
E86596432701611A00846EBD /* UIImage+ImageEffects.m in Sources */,
|
||||
E8ACEFE927C8BC1600F66D1A /* XPHomeRecommendHeaderView.m in Sources */,
|
||||
E8E20BEF2816A5FC0033B688 /* XPMineBlackListTableViewCell.m in Sources */,
|
||||
18486217271EAB8C005FC5DC /* BaseRtcImpl.m in Sources */,
|
||||
E8DACCFB2766EDC60052092C /* MicroGiftValueView.m in Sources */,
|
||||
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */,
|
||||
|
@@ -14,6 +14,8 @@ typedef NS_ENUM(NSInteger, XPMineSettingItemType){
|
||||
XPMineSettingItemType_Pay_Password,///支付密码
|
||||
///登录密码
|
||||
XPMineSettingItemType_Login_Password,
|
||||
///黑名单管理
|
||||
XPMineSettingItemType_Black_Manager,
|
||||
XPMineSettingItemType_Notification_Remind, ///通知提醒
|
||||
XPMineSettingItemType_Permission,///关于我们
|
||||
XPMineSettingItemType_Helper,///帮助
|
||||
|
@@ -57,6 +57,11 @@
|
||||
loginItem.type = XPMineSettingItemType_Login_Password;
|
||||
self.loginItem = loginItem;
|
||||
|
||||
XPMineSettingItemModel * blackListItem = [[XPMineSettingItemModel alloc] init];
|
||||
blackListItem.title = @"黑名单管理";
|
||||
blackListItem.subTitle = @"";
|
||||
blackListItem.type = XPMineSettingItemType_Black_Manager;
|
||||
|
||||
XPMineSettingItemModel * payItem = [[XPMineSettingItemModel alloc] init];
|
||||
payItem.title = @"支付密码";
|
||||
payItem.subTitle = userinfo.isBindPaymentPwd ? @"修改" : @"设置";
|
||||
@@ -94,7 +99,7 @@
|
||||
aboutusItem.type = XPMineSettingItemType_About_Us;
|
||||
|
||||
NSArray * oneSection = @[phoneItem];
|
||||
NSArray * twoSection = @[loginItem,payItem, notificaItem];
|
||||
NSArray * twoSection = @[loginItem,payItem, notificaItem, blackListItem];
|
||||
NSArray * threeSection = @[privacyItem];
|
||||
NSArray * fourthSection = @[helperItem, feedbackItem, clearMemoryItem, aboutusItem];
|
||||
|
||||
|
16
xplan-ios/Main/Mine/View/Cell/XPMineBlackListTableViewCell.h
Normal file
16
xplan-ios/Main/Mine/View/Cell/XPMineBlackListTableViewCell.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPMineBlackListTableViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class NIMUser;
|
||||
@interface XPMineBlackListTableViewCell : UITableViewCell
|
||||
@property (nonatomic,strong) NIMUser *userInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
84
xplan-ios/Main/Mine/View/Cell/XPMineBlackListTableViewCell.m
Normal file
84
xplan-ios/Main/Mine/View/Cell/XPMineBlackListTableViewCell.m
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// XPMineBlackListTableViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import "XPMineBlackListTableViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
///Tool
|
||||
#import "NetImageView.h"
|
||||
|
||||
@interface XPMineBlackListTableViewCell ()
|
||||
///头像
|
||||
@property (nonatomic,strong) NetImageView *avatarImageView;
|
||||
///昵称
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPMineBlackListTableViewCell
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [ThemeColor appCellBackgroundColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self.contentView addSubview:self.avatarImageView];
|
||||
[self.contentView addSubview:self.nickLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(40, 40));
|
||||
make.centerY.mas_equalTo(self.contentView);
|
||||
make.left.mas_equalTo(self.contentView).offset(15);
|
||||
}];
|
||||
|
||||
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(10);
|
||||
make.right.mas_lessThanOrEqualTo(self.contentView).offset(-5);
|
||||
make.centerY.mas_equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setUserInfo:(NIMUser *)userInfo {
|
||||
_userInfo = userInfo;
|
||||
if (_userInfo) {
|
||||
self.avatarImageView.imageUrl = _userInfo.userInfo.avatarUrl;
|
||||
self.nickLabel.text = _userInfo.userInfo.nickName;
|
||||
}
|
||||
}
|
||||
|
||||
- (NetImageView *)avatarImageView {
|
||||
if (!_avatarImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatarImageView.layer.masksToBounds = YES;
|
||||
_avatarImageView.layer.cornerRadius = 20;
|
||||
}
|
||||
return _avatarImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)nickLabel {
|
||||
if (!_nickLabel) {
|
||||
_nickLabel = [[UILabel alloc] init];
|
||||
_nickLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
||||
_nickLabel.textColor = [ThemeColor mainTextColor];
|
||||
}
|
||||
return _nickLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPMineBlackListViewController.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineBlackListViewController : BaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
107
xplan-ios/Main/Mine/View/Setting/XPMineBlackListViewController.m
Normal file
107
xplan-ios/Main/Mine/View/Setting/XPMineBlackListViewController.m
Normal file
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// XPMineBlackListViewController.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/4/25.
|
||||
//
|
||||
|
||||
#import "XPMineBlackListViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import "XPMineBlackListTableViewCell.h"
|
||||
#import "XPMineFriendEmptyTableViewCell.h"
|
||||
|
||||
@interface XPMineBlackListViewController ()<UITableViewDelegate, UITableViewDataSource>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///
|
||||
@property (nonatomic,strong) NSArray<NIMUser *> *datasource;
|
||||
@end
|
||||
|
||||
@implementation XPMineBlackListViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.datasource = [[NIMSDK sharedSDK].userManager myBlackList];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.title = @"黑名单";
|
||||
[self.view addSubview:self.tableView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate And UITableViewDataSource
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.datasource.count > 0 ? self.datasource.count : 1;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return self.datasource.count > 0 ? 60 : 500;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (self.datasource.count > 0) {
|
||||
XPMineBlackListTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineBlackListTableViewCell class])];
|
||||
cell.userInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
XPMineFriendEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineFriendEmptyTableViewCell class])];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.datasource.count > 0) {
|
||||
return UITableViewCellEditingStyleDelete;
|
||||
}
|
||||
return UITableViewCellEditingStyleNone;
|
||||
}
|
||||
|
||||
-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return @"移除";
|
||||
}
|
||||
|
||||
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (editingStyle ==UITableViewCellEditingStyleDelete){
|
||||
if (self.datasource.count > 0) {
|
||||
NIMUser *userInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
[[NIMSDK sharedSDK].userManager removeFromBlackBlackList:userInfo.userId completion:^(NSError * _Nullable error) {
|
||||
if (error == nil) {
|
||||
self.datasource = [[NIMSDK sharedSDK].userManager myBlackList];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
if (@available(iOS 11.0, *)) {
|
||||
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
[_tableView registerClass:[XPMineBlackListTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineBlackListTableViewCell class])];
|
||||
[_tableView registerClass:[XPMineFriendEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineFriendEmptyTableViewCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -33,6 +33,7 @@
|
||||
#import "XPMineModifPayPwdViewController.h"
|
||||
#import "XPPrivacyViewController.h"
|
||||
#import "XPMineLoginPasswordViewController.h"
|
||||
#import "XPMineBlackListViewController.h"
|
||||
///不同模块的VC
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPLoginVerifBindPhoneViewController.h"
|
||||
@@ -141,6 +142,12 @@
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XPMineSettingItemType_Black_Manager:
|
||||
{
|
||||
XPMineBlackListViewController * blackMangerVC = [[XPMineBlackListViewController alloc] init];
|
||||
[self.navigationController pushViewController:blackMangerVC animated:YES];
|
||||
}
|
||||
break;
|
||||
case XPMineSettingItemType_Notification_Remind:
|
||||
{
|
||||
XPMineNotificaViewController * notiVC = [[XPMineNotificaViewController alloc] init];
|
||||
|
Reference in New Issue
Block a user