房间收藏优化

This commit is contained in:
chenguilong
2022-10-12 15:30:34 +08:00
parent e00b799073
commit 3385e4826f
25 changed files with 930 additions and 126 deletions

View File

@@ -272,6 +272,8 @@
9BC5C91F277C902B007C8719 /* XPReleaseRadioView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC5C91E277C902B007C8719 /* XPReleaseRadioView.m */; }; 9BC5C91F277C902B007C8719 /* XPReleaseRadioView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC5C91E277C902B007C8719 /* XPReleaseRadioView.m */; };
9BC8C83028090C9200C24F85 /* XPRoomAnchorRankBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC8C82F28090C9200C24F85 /* XPRoomAnchorRankBannerView.m */; }; 9BC8C83028090C9200C24F85 /* XPRoomAnchorRankBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC8C82F28090C9200C24F85 /* XPRoomAnchorRankBannerView.m */; };
9BC9DAEF27E33B3F009EE409 /* XPRoomGiftAnimationParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC9DAEE27E33B3F009EE409 /* XPRoomGiftAnimationParser.m */; }; 9BC9DAEF27E33B3F009EE409 /* XPRoomGiftAnimationParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BC9DAEE27E33B3F009EE409 /* XPRoomGiftAnimationParser.m */; };
9BCB99A028F571B500466D64 /* XPMineCollectPartyRoomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BCB999F28F571B500466D64 /* XPMineCollectPartyRoomViewController.m */; };
9BCB99A628F582EC00466D64 /* XPMineCollectRoomEditCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BCB99A528F582EC00466D64 /* XPMineCollectRoomEditCell.m */; };
9BCD02C72796C02800F396AA /* MicroNobleWaveView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BCD02C62796C02800F396AA /* MicroNobleWaveView.m */; }; 9BCD02C72796C02800F396AA /* MicroNobleWaveView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BCD02C62796C02800F396AA /* MicroNobleWaveView.m */; };
9BCE6144277D657600CC0358 /* XPReleaseRadioTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BCE6143277D657600CC0358 /* XPReleaseRadioTableViewCell.m */; }; 9BCE6144277D657600CC0358 /* XPReleaseRadioTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BCE6143277D657600CC0358 /* XPReleaseRadioTableViewCell.m */; };
9BCE6147277D665600CC0358 /* XPReleaseRadioCellModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BCE6146277D665600CC0358 /* XPReleaseRadioCellModel.m */; }; 9BCE6147277D665600CC0358 /* XPReleaseRadioCellModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BCE6146277D665600CC0358 /* XPReleaseRadioCellModel.m */; };
@@ -315,6 +317,7 @@
9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */; }; 9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */; };
9BE29A6D27D210A500446AB5 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */; }; 9BE29A6D27D210A500446AB5 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */; };
9BE2FA90288010D300EF3D83 /* AnchorRoomSrollTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE2FA8F288010D300EF3D83 /* AnchorRoomSrollTipView.m */; }; 9BE2FA90288010D300EF3D83 /* AnchorRoomSrollTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE2FA8F288010D300EF3D83 /* AnchorRoomSrollTipView.m */; };
9BE570BC28F65B7200D491A5 /* XPMineCollectRoomCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE570BB28F65B7200D491A5 /* XPMineCollectRoomCell.m */; };
9BE9F0F927FED12D00667200 /* XPAnchorFansPrivilegeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0F827FED12D00667200 /* XPAnchorFansPrivilegeModel.m */; }; 9BE9F0F927FED12D00667200 /* XPAnchorFansPrivilegeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0F827FED12D00667200 /* XPAnchorFansPrivilegeModel.m */; };
9BE9F0FC27FED2E100667200 /* XPAnchorFansJoinModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0FB27FED2E100667200 /* XPAnchorFansJoinModel.m */; }; 9BE9F0FC27FED2E100667200 /* XPAnchorFansJoinModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0FB27FED2E100667200 /* XPAnchorFansJoinModel.m */; };
9BE9F0FF27FED76500667200 /* XPAnchorFansTaskModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0FE27FED76500667200 /* XPAnchorFansTaskModel.m */; }; 9BE9F0FF27FED76500667200 /* XPAnchorFansTaskModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0FE27FED76500667200 /* XPAnchorFansTaskModel.m */; };
@@ -1720,6 +1723,10 @@
9BC8C82F28090C9200C24F85 /* XPRoomAnchorRankBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomAnchorRankBannerView.m; sourceTree = "<group>"; }; 9BC8C82F28090C9200C24F85 /* XPRoomAnchorRankBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomAnchorRankBannerView.m; sourceTree = "<group>"; };
9BC9DAED27E33B3F009EE409 /* XPRoomGiftAnimationParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomGiftAnimationParser.h; sourceTree = "<group>"; }; 9BC9DAED27E33B3F009EE409 /* XPRoomGiftAnimationParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomGiftAnimationParser.h; sourceTree = "<group>"; };
9BC9DAEE27E33B3F009EE409 /* XPRoomGiftAnimationParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomGiftAnimationParser.m; sourceTree = "<group>"; }; 9BC9DAEE27E33B3F009EE409 /* XPRoomGiftAnimationParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomGiftAnimationParser.m; sourceTree = "<group>"; };
9BCB999E28F571B500466D64 /* XPMineCollectPartyRoomViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineCollectPartyRoomViewController.h; sourceTree = "<group>"; };
9BCB999F28F571B500466D64 /* XPMineCollectPartyRoomViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineCollectPartyRoomViewController.m; sourceTree = "<group>"; };
9BCB99A428F582EC00466D64 /* XPMineCollectRoomEditCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineCollectRoomEditCell.h; sourceTree = "<group>"; };
9BCB99A528F582EC00466D64 /* XPMineCollectRoomEditCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineCollectRoomEditCell.m; sourceTree = "<group>"; };
9BCD02C52796C02800F396AA /* MicroNobleWaveView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroNobleWaveView.h; sourceTree = "<group>"; }; 9BCD02C52796C02800F396AA /* MicroNobleWaveView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroNobleWaveView.h; sourceTree = "<group>"; };
9BCD02C62796C02800F396AA /* MicroNobleWaveView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroNobleWaveView.m; sourceTree = "<group>"; }; 9BCD02C62796C02800F396AA /* MicroNobleWaveView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroNobleWaveView.m; sourceTree = "<group>"; };
9BCE6142277D657600CC0358 /* XPReleaseRadioTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPReleaseRadioTableViewCell.h; sourceTree = "<group>"; }; 9BCE6142277D657600CC0358 /* XPReleaseRadioTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPReleaseRadioTableViewCell.h; sourceTree = "<group>"; };
@@ -1810,6 +1817,8 @@
9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = "<group>"; }; 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = "<group>"; };
9BE2FA8E288010D300EF3D83 /* AnchorRoomSrollTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorRoomSrollTipView.h; sourceTree = "<group>"; }; 9BE2FA8E288010D300EF3D83 /* AnchorRoomSrollTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorRoomSrollTipView.h; sourceTree = "<group>"; };
9BE2FA8F288010D300EF3D83 /* AnchorRoomSrollTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorRoomSrollTipView.m; sourceTree = "<group>"; }; 9BE2FA8F288010D300EF3D83 /* AnchorRoomSrollTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorRoomSrollTipView.m; sourceTree = "<group>"; };
9BE570BA28F65B7200D491A5 /* XPMineCollectRoomCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineCollectRoomCell.h; sourceTree = "<group>"; };
9BE570BB28F65B7200D491A5 /* XPMineCollectRoomCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineCollectRoomCell.m; sourceTree = "<group>"; };
9BE9F0F727FED12D00667200 /* XPAnchorFansPrivilegeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansPrivilegeModel.h; sourceTree = "<group>"; }; 9BE9F0F727FED12D00667200 /* XPAnchorFansPrivilegeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansPrivilegeModel.h; sourceTree = "<group>"; };
9BE9F0F827FED12D00667200 /* XPAnchorFansPrivilegeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorFansPrivilegeModel.m; sourceTree = "<group>"; }; 9BE9F0F827FED12D00667200 /* XPAnchorFansPrivilegeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorFansPrivilegeModel.m; sourceTree = "<group>"; };
9BE9F0FA27FED2E100667200 /* XPAnchorFansJoinModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansJoinModel.h; sourceTree = "<group>"; }; 9BE9F0FA27FED2E100667200 /* XPAnchorFansJoinModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansJoinModel.h; sourceTree = "<group>"; };
@@ -4878,6 +4887,16 @@
path = Presenter; path = Presenter;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9BCB999D28F5716E00466D64 /* CollectRoom */ = {
isa = PBXGroup;
children = (
9BE570B928F65B6000D491A5 /* Cell */,
9BCB999E28F571B500466D64 /* XPMineCollectPartyRoomViewController.h */,
9BCB999F28F571B500466D64 /* XPMineCollectPartyRoomViewController.m */,
);
path = CollectRoom;
sourceTree = "<group>";
};
9BD2ECCF288F832300F5CD9A /* FootPrint */ = { 9BD2ECCF288F832300F5CD9A /* FootPrint */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -5016,6 +5035,17 @@
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
9BE570B928F65B6000D491A5 /* Cell */ = {
isa = PBXGroup;
children = (
9BE570BA28F65B7200D491A5 /* XPMineCollectRoomCell.h */,
9BE570BB28F65B7200D491A5 /* XPMineCollectRoomCell.m */,
9BCB99A428F582EC00466D64 /* XPMineCollectRoomEditCell.h */,
9BCB99A528F582EC00466D64 /* XPMineCollectRoomEditCell.m */,
);
path = Cell;
sourceTree = "<group>";
};
9BFB10172897C95200B3985E /* NewUserRecharge */ = { 9BFB10172897C95200B3985E /* NewUserRecharge */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -8201,6 +8231,7 @@
E8E70D7126F2EB4900F03460 /* View */ = { E8E70D7126F2EB4900F03460 /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9BCB999D28F5716E00466D64 /* CollectRoom */,
E8E20BDF281695430033B688 /* Setting */, E8E20BDF281695430033B688 /* Setting */,
E800805227FD33950055A8AB /* Guild */, E800805227FD33950055A8AB /* Guild */,
E896EF912771AA6C00AD2CC1 /* Friend */, E896EF912771AA6C00AD2CC1 /* Friend */,
@@ -9016,6 +9047,7 @@
E86A16C52856DBEC004228B8 /* FindNewGreetListModel.m in Sources */, E86A16C52856DBEC004228B8 /* FindNewGreetListModel.m in Sources */,
E81366F826F0C12A0076364C /* LoginFullInfoProtocol.h in Sources */, E81366F826F0C12A0076364C /* LoginFullInfoProtocol.h in Sources */,
9BBC028E2786FA060007C24B /* NobleCardModel.m in Sources */, 9BBC028E2786FA060007C24B /* NobleCardModel.m in Sources */,
9BCB99A628F582EC00466D64 /* XPMineCollectRoomEditCell.m in Sources */,
E8E70D7E26F2F19D00F03460 /* Api+Mine.m in Sources */, E8E70D7E26F2F19D00F03460 /* Api+Mine.m in Sources */,
E8751E6E28A64F990056EF44 /* XPSailingEmptyTableViewCell.m in Sources */, E8751E6E28A64F990056EF44 /* XPSailingEmptyTableViewCell.m in Sources */,
9B4D148127E485EB000AA0C1 /* XPRoomTrumpetView.m in Sources */, 9B4D148127E485EB000AA0C1 /* XPRoomTrumpetView.m in Sources */,
@@ -9053,6 +9085,7 @@
E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */, E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */,
E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */, E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */,
9BAC92F528E6E63000147DD8 /* XPRoomInsideOperationCell.m in Sources */, 9BAC92F528E6E63000147DD8 /* XPRoomInsideOperationCell.m in Sources */,
9BE570BC28F65B7200D491A5 /* XPMineCollectRoomCell.m in Sources */,
E86A16C22856D635004228B8 /* XPSessionFindNewGreetTableViewCell.m in Sources */, E86A16C22856D635004228B8 /* XPSessionFindNewGreetTableViewCell.m in Sources */,
E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */, E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */,
E86E79CD28A4E045006DAF48 /* MessageContentRiskAlertView.m in Sources */, E86E79CD28A4E045006DAF48 /* MessageContentRiskAlertView.m in Sources */,
@@ -9238,6 +9271,7 @@
E852D74728633E92001465ED /* MonentsCommentReplyModel.m in Sources */, E852D74728633E92001465ED /* MonentsCommentReplyModel.m in Sources */,
186A534926FC6ED900D67B2C /* TTAlertMessageAttributedConfig.m in Sources */, 186A534926FC6ED900D67B2C /* TTAlertMessageAttributedConfig.m in Sources */,
E8B3E80C2848BA40009746AB /* NewUserGreetModel.m in Sources */, E8B3E80C2848BA40009746AB /* NewUserGreetModel.m in Sources */,
9BCB99A028F571B500466D64 /* XPMineCollectPartyRoomViewController.m in Sources */,
E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */, E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */,
E8AB631028ADD92D0023B0D2 /* XPMonentsTopicRecommondViewController.m in Sources */, E8AB631028ADD92D0023B0D2 /* XPMonentsTopicRecommondViewController.m in Sources */,
E877A7F127842B2F00EFACED /* XPRoomDatingWebAlertView.m in Sources */, E877A7F127842B2F00EFACED /* XPRoomDatingWebAlertView.m in Sources */,

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "collect_room_edit_selected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "collect_room_edit_selected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "collect_room_edit_selected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "collect_room_edit_selected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

View File

@@ -28,6 +28,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *roomUid; @property (nonatomic,copy) NSString *roomUid;
///麦上用户 ///麦上用户
@property (nonatomic, strong) NSArray<HomePlayMicUserModel *> *micUsers; @property (nonatomic, strong) NSArray<HomePlayMicUserModel *> *micUsers;
///是否选中
@property (nonatomic, assign) BOOL isSelected;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -268,7 +268,8 @@ NS_ASSUME_NONNULL_BEGIN
/// @param uid 用户的uid /// @param uid 用户的uid
/// @param page 当前页数 /// @param page 当前页数
/// @param pageSize 一页多少个 /// @param pageSize 一页多少个
+ (void)requestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize; /// @param roomType 类型4个播房其他派对房不传所有房间
+ (void)requestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType;
@end @end

View File

@@ -297,8 +297,9 @@
/// @param uid uid /// @param uid uid
/// @param page /// @param page
/// @param pageSize /// @param pageSize
+ (void)requestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize { /// @param roomType 4
[self makeRequest:@"fans/fansRoomList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , page, pageSize,nil]; + (void)requestMineCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize roomType:(NSString *)roomType {
[self makeRequest:@"fans/fansRoomList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , page, pageSize, roomType, nil];
} }
@end @end

View File

@@ -14,7 +14,11 @@ NS_ASSUME_NONNULL_BEGIN
/// 获取收藏房间列表 /// 获取收藏房间列表
/// @param page 当前的页数 /// @param page 当前的页数
/// @param pageSize 一页多少个 /// @param pageSize 一页多少个
- (void)getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state; /// @param type 类型4个播房其他派对房不传所有房间
- (void)getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state type:(NSString *)type;
///批量删除收藏的房间
- (void)deletecollectRoomWithRoomUids:(NSString *)roomUids;
@end @end

View File

@@ -7,6 +7,7 @@
#import "XPMineCollectRoomListPresenter.h" #import "XPMineCollectRoomListPresenter.h"
#import "Api+Mine.h" #import "Api+Mine.h"
#import "Api+Room.h"
#import "XPMineCollectRoomListProtocol.h" #import "XPMineCollectRoomListProtocol.h"
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "HomeCollectRoomModel.h" #import "HomeCollectRoomModel.h"
@@ -16,14 +17,24 @@
/// ///
/// @param page /// @param page
/// @param pageSize /// @param pageSize
- (void)getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state { /// @param type 4
- (void)getCollectRoomList:(int)page pageSize:(int)pageSize state:(int)state type:(NSString *)type {
NSString * uid = [AccountInfoStorage instance].getUid; NSString * uid = [AccountInfoStorage instance].getUid;
[Api requestMineCollectRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api requestMineCollectRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeCollectRoomModel modelsWithArray:data.data[@"fansRoomList"]]; NSArray * array = [HomeCollectRoomModel modelsWithArray:data.data[@"fansRoomList"]];
[[self getView] onGetCollectRoomListSuccess:array state:state]; [[self getView] onGetCollectRoomListSuccess:array state:state];
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getCollectRoomListFail:state]; [[self getView] getCollectRoomListFail:state];
}] uid:uid page:[NSString stringWithFormat:@"%d", page] pageSize:[NSString stringWithFormat:@"%d", pageSize]]; }] uid:uid page:[NSString stringWithFormat:@"%d", page] pageSize:[NSString stringWithFormat:@"%d", pageSize] roomType:type.length ? type : NULL];
}
///
- (void)deletecollectRoomWithRoomUids:(NSString *)roomUids {
NSString * type = @"3";
NSString * uid = [AccountInfoStorage instance].getUid;
[Api collectRoom:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] deleteCollectRoomSuccess];
}] roomUid:@"" uid:uid type:type roomUids:roomUids];
} }
@end @end

View File

@@ -43,7 +43,7 @@
NSString * uid = [AccountInfoStorage instance].getUid; NSString * uid = [AccountInfoStorage instance].getUid;
[Api collectRoom:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api collectRoom:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] collectRoomSuccess]; [[self getView] collectRoomSuccess];
}] roomUid:roomUid uid:uid type:type]; }] roomUid:roomUid uid:uid type:type roomUids:NULL];
} }
@end @end

View File

@@ -15,4 +15,7 @@
///获取收藏房间列表失败 ///获取收藏房间列表失败
- (void)getCollectRoomListFail:(int)state; - (void)getCollectRoomListFail:(int)state;
///批量删除收藏的房间成功
- (void)deleteCollectRoomSuccess;
@end @end

View File

@@ -0,0 +1,19 @@
//
// XPMineCollectRoomCell.h
// xplan-ios
//
// Created by GreenLand on 2022/10/12.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class HomeCollectRoomModel;
@interface XPMineCollectRoomCell : UITableViewCell
@property (nonatomic,strong) HomeCollectRoomModel *roomInfo;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,126 @@
//
// XPMineCollectRoomCell.m
// xplan-ios
//
// Created by GreenLand on 2022/10/12.
//
#import "XPMineCollectRoomCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "UIImage+Utils.h"
///Model
#import "HomeCollectRoomModel.h"
@interface XPMineCollectRoomCell ()
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UILabel *nickLabel;
///id
@property (nonatomic,strong) UILabel *idLabel;
///线
@property (nonatomic, strong) UIView *devideView;
@end
@implementation XPMineCollectRoomCell
- (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 = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.avatarImageView];
[self.contentView addSubview:self.nickLabel];
[self.contentView addSubview:self.idLabel];
[self.contentView addSubview:self.devideView];
}
- (void)initSubViewConstraints {
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(44, 44));
make.left.mas_equalTo(self.contentView).offset(15);
make.centerY.mas_equalTo(self.contentView);
}];
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(7);
make.top.mas_equalTo(self.avatarImageView).offset(2);
make.right.mas_equalTo(-15);
make.height.mas_equalTo(14);
}];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.nickLabel.mas_bottom).mas_offset(8);
make.left.mas_equalTo(self.nickLabel);
make.height.mas_equalTo(14);
}];
[self.devideView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.nickLabel);
make.height.mas_equalTo(0.5);
make.right.bottom.mas_equalTo(0);
}];
}
#pragma mark - Getters And Setters
- (void)setRoomInfo:(HomeCollectRoomModel *)roomInfo {
_roomInfo = roomInfo;
if (_roomInfo) {
self.avatarImageView.imageUrl = _roomInfo.roomAvatar;
self.nickLabel.text = _roomInfo.roomName;
self.idLabel.text = [NSString stringWithFormat:@"ID:%@", _roomInfo.erbanNo];
}
}
- (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 = 22;
_avatarImageView.layer.borderColor = [ThemeColor appMainColor].CGColor;
}
return _avatarImageView;
}
- (UILabel *)nickLabel {
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
_nickLabel.font = [UIFont systemFontOfSize:14];
_nickLabel.textColor = [ThemeColor mainTextColor];
}
return _nickLabel;
}
- (UILabel *)idLabel {
if (!_idLabel) {
_idLabel = [[UILabel alloc] init];
_idLabel.font = [UIFont systemFontOfSize:12];
_idLabel.textColor = [ThemeColor secondTextColor];
}
return _idLabel;
}
- (UIView *)devideView {
if (!_devideView) {
_devideView = [[UIView alloc] init];
_devideView.backgroundColor = UIColorFromRGB(0xEAEAF1);
}
return _devideView;
}
@end

View File

@@ -0,0 +1,18 @@
//
// XPMineCollectRoomEditCell.h
// xplan-ios
//
// Created by GreenLand on 2022/10/11.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class HomeCollectRoomModel;
@interface XPMineCollectRoomEditCell : UITableViewCell
@property (nonatomic,strong) HomeCollectRoomModel *roomInfo;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,145 @@
//
// XPMineCollectRoomEditCell.m
// xplan-ios
//
// Created by GreenLand on 2022/10/11.
//
#import "XPMineCollectRoomEditCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "UIImage+Utils.h"
///Model
#import "HomeCollectRoomModel.h"
@interface XPMineCollectRoomEditCell ()
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UILabel *nickLabel;
///id
@property (nonatomic,strong) UILabel *idLabel;
///
@property (nonatomic, strong) UIButton *selectBtn;
///线
@property (nonatomic, strong) UIView *devideView;
@end
@implementation XPMineCollectRoomEditCell
- (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 = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.avatarImageView];
[self.contentView addSubview:self.nickLabel];
[self.contentView addSubview:self.idLabel];
[self.contentView addSubview:self.devideView];
[self.contentView addSubview:self.selectBtn];
}
- (void)initSubViewConstraints {
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(44, 44));
make.left.mas_equalTo(self.selectBtn.mas_right).offset(15);
make.centerY.mas_equalTo(self.contentView);
}];
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(7);
make.top.mas_equalTo(self.avatarImageView).offset(2);
make.right.mas_equalTo(-15);
make.height.mas_equalTo(14);
}];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.nickLabel.mas_bottom).mas_offset(8);
make.left.mas_equalTo(self.nickLabel);
make.height.mas_equalTo(14);
}];
[self.devideView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.nickLabel);
make.height.mas_equalTo(0.5);
make.right.bottom.mas_equalTo(0);
}];
[self.selectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20, 20));
make.left.mas_equalTo(15);
make.centerY.mas_equalTo(self.contentView);
}];
}
#pragma mark - Getters And Setters
- (void)setRoomInfo:(HomeCollectRoomModel *)roomInfo {
_roomInfo = roomInfo;
if (_roomInfo) {
self.avatarImageView.imageUrl = _roomInfo.roomAvatar;
self.nickLabel.text = _roomInfo.roomName;
self.idLabel.text = [NSString stringWithFormat:@"ID:%@", _roomInfo.erbanNo];
self.selectBtn.selected = roomInfo.isSelected;
}
}
- (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 = 22;
_avatarImageView.layer.borderColor = [ThemeColor appMainColor].CGColor;
}
return _avatarImageView;
}
- (UILabel *)nickLabel {
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
_nickLabel.font = [UIFont systemFontOfSize:14];
_nickLabel.textColor = [ThemeColor mainTextColor];
}
return _nickLabel;
}
- (UILabel *)idLabel {
if (!_idLabel) {
_idLabel = [[UILabel alloc] init];
_idLabel.font = [UIFont systemFontOfSize:12];
_idLabel.textColor = [ThemeColor secondTextColor];
}
return _idLabel;
}
- (UIButton *)selectBtn {
if (!_selectBtn) {
_selectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_selectBtn setImage:[UIImage imageNamed:@"collect_room_edit_normal"] forState:UIControlStateNormal];
[_selectBtn setImage:[UIImage imageNamed:@"collect_room_edit_selected"] forState:UIControlStateSelected];
_selectBtn.userInteractionEnabled = NO;
}
return _selectBtn;
}
- (UIView *)devideView {
if (!_devideView) {
_devideView = [[UIView alloc] init];
_devideView.backgroundColor = UIColorFromRGB(0xEAEAF1);
}
return _devideView;
}
@end

View File

@@ -0,0 +1,32 @@
//
// XPMineCollectPartyRoomViewController.h
// xplan-ios
//
// Created by GreenLand on 2022/10/11.
//
#import "MvpViewController.h"
#import <JXCategoryView/JXCategoryListContainerView.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, MineCollectRoomType) {
MineCollectRoomTypeParty,
MineCollectRoomTypeAnchor
};
@interface XPMineCollectPartyRoomViewController : MvpViewController<JXCategoryListContentViewDelegate>
@property (nonatomic, assign) MineCollectRoomType type;
///数据源
@property (nonatomic,strong, readonly) NSMutableArray *datasource;
///是否为编辑模式
@property (nonatomic, assign) BOOL isEdit;
///是否选中所有
@property (nonatomic, assign) BOOL isSelectAll;
///刷新数据
- (void)headerRefresh;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,226 @@
//
// XPMineCollectPartyRoomViewController.m
// xplan-ios
//
// Created by GreenLand on 2022/10/11.
//
#import "XPMineCollectPartyRoomViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <MJRefresh/MJRefresh.h>
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
///Model
#import "HomeCollectRoomModel.h"
///P
#import "XPMineCollectRoomListPresenter.h"
#import "XPMineCollectRoomListProtocol.h"
///View
#import "XPMineCollectRoomCell.h"
#import "XPMineVisitorEmptyTableViewCell.h"
#import "XPMineCollectRoomEditCell.h"
///VC
#import "XPRoomViewController.h"
@interface XPMineCollectPartyRoomViewController ()<UITableViewDelegate,UITableViewDataSource, XPMineCollectRoomListProtocol>
///
@property (nonatomic,strong) UITableView *tableView;
///
@property (nonatomic,strong) NSMutableArray *datasource;
///
@property (nonatomic,assign) int page;
///
@property (nonatomic,assign) BOOL hasNoMoreData;
@end
@implementation XPMineCollectPartyRoomViewController
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
}
- (XPMineCollectRoomListPresenter *)createPresenter {
return [[XPMineCollectRoomListPresenter alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self initHeaderAndFooterRrfresh];
[self initSubViews];
[self initSubViewConstraints];
}
#pragma mark -
- (void)initHeaderAndFooterRrfresh {
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
header.stateLabel.textColor = [ThemeColor secondTextColor];
header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor];
self.tableView.mj_header = header;
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
footer.stateLabel.textColor = [ThemeColor secondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
self.tableView.mj_footer = footer;
[self headerRefresh];
}
#pragma mark - fangfa
- (void)headerRefresh {
self.page = 1;
[self.presenter getCollectRoomList:self.page pageSize:20 state:0 type:self.type == MineCollectRoomTypeParty ? @"1" : @"4"];
}
- (void)footerRefresh {
if (self.hasNoMoreData) {
[self showErrorToast:@"没有更多收藏记录了"];
return;
}
self.page++;
[self.presenter getCollectRoomList:self.page pageSize:20 state:1 type:self.type == MineCollectRoomTypeParty ? @"1" : @"4"];
}
#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 - XPMineCollectRoomListProtocol
///访
- (void)onGetCollectRoomListSuccess:(NSArray *)array state:(int)state {
if (state == 0) {
[self.datasource removeAllObjects];
[self.tableView.mj_header endRefreshing];
}
[self.tableView.mj_footer endRefreshing];
if (array.count > 0) {
self.hasNoMoreData = NO;
[self.datasource addObjectsFromArray:array];
} else {
self.hasNoMoreData = YES;
[self.tableView.mj_footer endRefreshingWithNoMoreData];
}
[self.tableView reloadData];
}
///访
- (void)getCollectRoomListFail:(int)state {
if (state == 0) {
[self.tableView.mj_header endRefreshing];
} else {
[self.tableView.mj_footer endRefreshing];
}
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.datasource.count > 0 ? self.datasource.count : 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
if (self.isEdit) {
XPMineCollectRoomEditCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineCollectRoomEditCell class])];
if (cell == nil) {
cell = [[XPMineCollectRoomEditCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineCollectRoomEditCell class])];
}
cell.roomInfo = [self.datasource objectAtIndex:indexPath.row];
return cell;
} else {
XPMineCollectRoomCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineCollectRoomCell class])];
if (cell == nil) {
cell = [[XPMineCollectRoomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineCollectRoomCell class])];
}
cell.roomInfo = [self.datasource objectAtIndex:indexPath.row];
return cell;
}
}
XPMineVisitorEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
if (cell == nil) {
cell = [[XPMineVisitorEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
}
cell.emptyTitle = @"暂无收藏的房间";
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 68;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
HomeCollectRoomModel * roomInfo = [self.datasource objectAtIndex:indexPath.row];
if (self.isEdit) {
roomInfo.isSelected = !roomInfo.isSelected;
[tableView reloadData];
} else {
if (roomInfo.roomUid.integerValue > 0) {
[XPRoomViewController openRoom:roomInfo.roomUid viewController:self];
}
}
}
- (void)setIsEdit:(BOOL)isEdit {
_isEdit = isEdit;
for (HomeCollectRoomModel *model in self.datasource) {
model.isSelected = NO;
}
[self.tableView reloadData];
}
- (void)setIsSelectAll:(BOOL)isSelectAll {
_isSelectAll = isSelectAll;
if (isSelectAll) {
for (HomeCollectRoomModel *model in self.datasource) {
model.isSelected = YES;
}
} else {
for (HomeCollectRoomModel *model in self.datasource) {
model.isSelected = NO;
}
}
[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.contentInset = UIEdgeInsetsMake(8, 0, 0, 0);
[_tableView registerClass:[XPMineVisitorEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
[_tableView registerClass:[XPMineCollectRoomCell class] forCellReuseIdentifier:NSStringFromClass([XPMineCollectRoomCell class])];
[_tableView registerClass:[XPMineCollectRoomEditCell class] forCellReuseIdentifier:NSStringFromClass([XPMineCollectRoomEditCell class])];
}
return _tableView;
}
- (NSMutableArray *)datasource {
if (!_datasource) {
_datasource = [NSMutableArray array];
}
return _datasource;
}
@end

View File

@@ -9,8 +9,12 @@
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <MJRefresh/MJRefresh.h> #import <MJRefresh/MJRefresh.h>
#import <JXCategoryView/JXCategoryListContainerView.h>
#import <JXCategoryView/JXCategoryView.h>
///Tool ///Tool
#import "ThemeColor.h" #import "ThemeColor.h"
#import "XPMacro.h"
#import "UIImage+Utils.h"
///Model ///Model
#import "HomeCollectRoomModel.h" #import "HomeCollectRoomModel.h"
///View ///View
@@ -21,16 +25,32 @@
#import "XPMineCollectRoomListProtocol.h" #import "XPMineCollectRoomListProtocol.h"
///VC ///VC
#import "XPRoomViewController.h" #import "XPRoomViewController.h"
#import "XPMineCollectPartyRoomViewController.h"
///tab
static NSString *lastSelectTab = @"lastSelectTab";
@interface XPMineCollectRoomListViewController ()<XPMineCollectRoomListProtocol, JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
///
@property (nonatomic,strong) NSArray<NSString *> *titles;
///
@property (nonatomic,strong) JXCategoryTitleView *titleView;
@property (nonatomic,strong) XPMineCollectPartyRoomViewController *partyVC;
///
@property (nonatomic, strong) XPMineCollectPartyRoomViewController *anchorRoomListVC;
@interface XPMineCollectRoomListViewController ()<UITableViewDelegate,UITableViewDataSource, XPMineCollectRoomListProtocol>
///
@property (nonatomic,strong) UITableView *tableView;
///
@property (nonatomic,strong) NSMutableArray *datasource;
///
@property (nonatomic,assign) int page;
/// ///
@property (nonatomic,assign) BOOL hasNoMoreData; @property (nonatomic,assign) BOOL hasNoMoreData;
///
@property (nonatomic, strong) UIView *bottomView;
///
@property (nonatomic, strong) UIButton *allSelectBtn;
///
@property (nonatomic, strong) UIButton *deleteBtn;
@end @end
@implementation XPMineCollectRoomListViewController @implementation XPMineCollectRoomListViewController
@@ -41,141 +61,249 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self initHeaderAndFooterRrfresh];
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
[self addNavigationItemWithTitles:@[@"管理"] titleColor:UIColorFromRGB(0x999999) isLeft:NO target:self action:@selector(managerButtonClick:) tags:nil];
} }
#pragma mark - - (void)managerButtonClick:(UIButton *)sender {
- (void)initHeaderAndFooterRrfresh { sender.selected = !sender.isSelected;
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; if (sender.isSelected) {//
header.stateLabel.font = [UIFont systemFontOfSize:10.0]; self.partyVC.isEdit = YES;
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0]; self.anchorRoomListVC.isEdit = YES;
header.stateLabel.textColor = [ThemeColor secondTextColor]; [sender setTitle:@"完成" forState:UIControlStateSelected];
header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor]; [sender setTitleColor:UIColorFromRGB(0x999999) forState:UIControlStateSelected];
self.tableView.mj_header = header; self.bottomView.hidden = NO;
} else {//
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)]; [sender setTitle:@"管理" forState:UIControlStateNormal];
footer.stateLabel.textColor = [ThemeColor secondTextColor]; [sender setTitleColor:UIColorFromRGB(0x999999) forState:UIControlStateNormal];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0]; self.bottomView.hidden = YES;
self.tableView.mj_footer = footer; self.allSelectBtn.selected = NO;
self.partyVC.isEdit = NO;
[self headerRefresh]; self.anchorRoomListVC.isEdit = NO;
self.allSelectBtn.selected = NO;
}
} }
#pragma mark - fangfa #pragma mark - JXCategoryListContainerViewDelegate
- (void)headerRefresh { - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
self.page = 1; return self.titles.count;
[self.presenter getCollectRoomList:self.page pageSize:20 state:0];
} }
- (void)footerRefresh { // index `JXCategoryListContentViewDelegate`
if (self.hasNoMoreData) { - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
[self showErrorToast:@"没有更多收藏记录了"]; if (index == 0) {
return; return self.partyVC;
}else if (index == 1) {
return self.anchorRoomListVC;
} }
self.page++; return nil;
[self.presenter getCollectRoomList:self.page pageSize:20 state:1]; }
#pragma mark - JXCategoryViewDelegate
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
//index
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:@(index) forKey:lastSelectTab];
[defaults synchronize];
}
#pragma mark - XPMineCollectRoomListProtocol
- (void)deleteCollectRoomSuccess {
[self showSuccessToast:@"取消收藏成功"];
if (self.titleView.selectedIndex == 0) {
[self.partyVC headerRefresh];
} else {
[self.anchorRoomListVC headerRefresh];
}
self.allSelectBtn.selected = NO;
} }
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
self.title = @"收藏的房间"; self.title = @"收藏的房间";
[self.view addSubview:self.tableView]; [self.view addSubview:self.titleView];
[self.view addSubview:self.listContainerView];
[self.view addSubview:self.bottomView];
[self.bottomView addSubview:self.allSelectBtn];
[self.bottomView addSubview:self.deleteBtn];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view); make.centerX.mas_equalTo(self.view);
make.width.mas_equalTo(180);
make.top.mas_equalTo(0);
make.height.mas_equalTo(44);
}];
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(self.titleView.mas_bottom);
}];
[self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(64+kSafeAreaBottomHeight);
make.left.bottom.right.mas_equalTo(0);
}];
[self.allSelectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(64);
make.height.mas_equalTo(22);
make.left.mas_equalTo(15);
make.top.mas_equalTo(18);
}];
[self.deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-15);
make.centerY.mas_equalTo(self.allSelectBtn);
make.size.mas_equalTo(CGSizeMake(72, 24));
}]; }];
} }
#pragma mark - XPMineCollectRoomListProtocol #pragma mark - action
- (void)allSelectBtnAction:(UIButton *)sender {
///访 sender.selected = !sender.selected;
- (void)onGetCollectRoomListSuccess:(NSArray *)array state:(int)state { if (self.titleView.selectedIndex == 0) {
if (state == 0) { self.partyVC.isSelectAll = sender.selected;
[self.datasource removeAllObjects];
[self.tableView.mj_header endRefreshing];
}
[self.tableView.mj_footer endRefreshing];
if (array.count > 0) {
self.hasNoMoreData = NO;
[self.datasource addObjectsFromArray:array];
} else { } else {
self.hasNoMoreData = YES; self.anchorRoomListVC.isSelectAll = sender.selected;
[self.tableView.mj_footer endRefreshingWithNoMoreData];
} }
[self.tableView reloadData];
} }
///访 - (void)deleteBtnAction:(UIButton *)sender {
- (void)getCollectRoomListFail:(int)state { if (self.titleView.selectedIndex == 0) {
if (state == 0) { NSMutableArray *roomUidsArray = [NSMutableArray array];
[self.tableView.mj_header endRefreshing]; for (HomeCollectRoomModel *model in self.partyVC.datasource) {
if (model.isSelected) {
[roomUidsArray addObject:model.roomUid];
}
}
if (roomUidsArray.count) {
NSString *roomUids = [roomUidsArray componentsJoinedByString:@","];
[self.presenter deletecollectRoomWithRoomUids:roomUids];
} else { } else {
[self.tableView.mj_footer endRefreshing]; [self showErrorToast:@"请选择房间"];
}
} else {
NSMutableArray *roomUidsArray = [NSMutableArray array];
for (HomeCollectRoomModel *model in self.anchorRoomListVC.datasource) {
if (model.isSelected) {
[roomUidsArray addObject:model.roomUid];
} }
} }
if (roomUidsArray.count) {
#pragma mark - UITableViewDelegate And UITableViewDataSource NSString *roomUids = [roomUidsArray componentsJoinedByString:@","];
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { [self.presenter deletecollectRoomWithRoomUids:roomUids];
return self.datasource.count > 0 ? self.datasource.count : 1; } else {
[self showErrorToast:@"请选择房间"];
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPHomeCollectRoomTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeCollectRoomTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeCollectRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeCollectRoomTableViewCell class])];
}
cell.roomInfo = [self.datasource objectAtIndex:indexPath.row];
return cell;
}
XPMineVisitorEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
if (cell == nil) {
cell = [[XPMineVisitorEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
}
cell.emptyTitle = @"暂无收藏的房间";
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 66 + 8 + 10;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
HomeCollectRoomModel * roomInfo = [self.datasource objectAtIndex:indexPath.row];
if (roomInfo.roomUid.integerValue > 0) {
[XPRoomViewController openRoom:roomInfo.roomUid viewController:self];
} }
} }
#pragma mark - Getters And Setters #pragma mark - Getters And Setters
- (UITableView *)tableView { - (UIView *)bottomView {
if (!_tableView) { if (!_bottomView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _bottomView = [[UIView alloc] init];
_tableView.delegate = self; _bottomView.backgroundColor = [UIColor whiteColor];
_tableView.dataSource = self; _bottomView.hidden = YES;
_tableView.tableFooterView = [UIView new]; UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth, 64+kSafeAreaBottomHeight) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(8, 8)];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone; CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
_tableView.backgroundColor = [UIColor clearColor]; maskLayer.frame = CGRectMake(0, 0, KScreenWidth, 64+kSafeAreaBottomHeight);
if (@available(iOS 11.0, *)) { maskLayer.path = maskPath.CGPath;
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; _bottomView.layer.mask = maskLayer;
} }
_tableView.contentInset = UIEdgeInsetsMake(8, 0, 0, 0); return _bottomView;
[_tableView registerClass:[XPMineVisitorEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineVisitorEmptyTableViewCell class])];
[_tableView registerClass:[XPHomeCollectRoomTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeCollectRoomTableViewCell class])];
}
return _tableView;
} }
- (NSMutableArray *)datasource { - (UIButton *)allSelectBtn {
if (!_datasource) { if (!_allSelectBtn) {
_datasource = [NSMutableArray array]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.titleLabel.font = [UIFont systemFontOfSize:16];
[button addTarget:self action:@selector(allSelectBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"全选" forState:UIControlStateNormal];
[button setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:@"collect_room_edit_normal"] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:@"collect_room_edit_selected"] forState:UIControlStateSelected];
_allSelectBtn = button;
} }
return _datasource; return _allSelectBtn;
}
- (UIButton *)deleteBtn {
if (!_deleteBtn) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.titleLabel.font = [UIFont systemFontOfSize:14];
[button addTarget:self action:@selector(deleteBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"删除" forState:UIControlStateNormal];
[button setTitleColor:UIColorFromRGB(0xFB486A) forState:UIControlStateNormal];
button.layer.cornerRadius = 12;
button.layer.masksToBounds = YES;
button.layer.borderWidth = 1;
button.layer.borderColor = UIColorFromRGB(0xFB486A).CGColor;
_deleteBtn = button;
}
return _deleteBtn;
}
#pragma mark - Getters And Setters
- (JXCategoryListContainerView *)listContainerView {
if (!_listContainerView) {
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
_listContainerView.scrollView.scrollEnabled = YES;
_listContainerView.scrollView.tag = 1000;
_listContainerView.listCellBackgroundColor = [UIColor clearColor];
}
return _listContainerView;
}
- (XPMineCollectPartyRoomViewController *)partyVC {
if (!_partyVC) {
_partyVC = [[XPMineCollectPartyRoomViewController alloc] init];
_partyVC.type = MineCollectRoomTypeParty;
}
return _partyVC;
}
- (XPMineCollectPartyRoomViewController *)anchorRoomListVC {
if (!_anchorRoomListVC) {
_anchorRoomListVC = [[XPMineCollectPartyRoomViewController alloc] init];
_anchorRoomListVC.type = MineCollectRoomTypeAnchor;
}
return _anchorRoomListVC;
}
- (NSArray<NSString *> *)titles {
if (!_titles) {
_titles = @[@"派对房", @"直播房"];
}
return _titles;
}
- (JXCategoryTitleView *)titleView {
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] initWithFrame:CGRectZero];
_titleView.backgroundColor =[UIColor clearColor];
_titleView.titleColor = [ThemeColor secondTextColor];
_titleView.titleSelectedColor = [ThemeColor mainTextColor];
_titleView.titleFont = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
_titleView.titleSelectedFont = [UIFont systemFontOfSize:14 weight:UIFontWeightHeavy];
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.averageCellSpacingEnabled = YES;
_titleView.listContainer = self.listContainerView;
_titleView.titles = self.titles;
_titleView.delegate = self;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSNumber *index = [defaults objectForKey:lastSelectTab];
_titleView.defaultSelectedIndex = index.intValue;
JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
lineView.indicatorImageViewSize = CGSizeMake(50, 8);
lineView.verticalMargin = 12;
lineView.indicatorImageView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x5BC8F8),UIColorFromRGB(0x66D9D9)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(50, 8)];
lineView.indicatorImageView.layer.masksToBounds = YES;
lineView.indicatorImageView.layer.cornerRadius = 4;
_titleView.indicators = @[lineView];
}
return _titleView;
} }
@end @end

View File

@@ -95,11 +95,13 @@ NS_ASSUME_NONNULL_BEGIN
/// @param completion 完成 /// @param completion 完成
/// @param roomUid 房间的uid /// @param roomUid 房间的uid
/// @param uid uid /// @param uid uid
/// @param type 1 收藏 2 取消收藏 /// @param type 1 收藏 2 取消收藏 3批量取消收藏
/// @param roomUids 批量删除的房间uid,用逗号隔开
+ (void)collectRoom:(HttpRequestHelperCompletion)completion + (void)collectRoom:(HttpRequestHelperCompletion)completion
roomUid:(NSString *)roomUid roomUid:(NSString *)roomUid
uid:(NSString *)uid uid:(NSString *)uid
type:(NSString *)type; type:(NSString *)type
roomUids:(NSString *)roomUids;
/// 改变相亲的状态的 /// 改变相亲的状态的
/// @param completion 完成 /// @param completion 完成

View File

@@ -105,9 +105,10 @@
/// @param completion /// @param completion
/// @param roomUid uid /// @param roomUid uid
/// @param uid uid /// @param uid uid
/// @param type 1 2 /// @param type 1 2 3
+ (void)collectRoom:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid type:(NSString *)type { /// @param roomUids uid,
[self makeRequest:@"fans/fansRoom" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, uid, type, nil]; + (void)collectRoom:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid uid:(NSString *)uid type:(NSString *)type roomUids:(NSString *)roomUids {
[self makeRequest:@"fans/fansRoom" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, roomUid, uid, type, roomUids, nil];
} }

View File

@@ -300,7 +300,7 @@
} else { } else {
[XCHUDTool showErrorWithMessage:msg]; [XCHUDTool showErrorWithMessage:msg];
} }
} roomUid:roomUid uid:uid type:type]; } roomUid:roomUid uid:uid type:type roomUids:NULL];
} }
#pragma mark - XCShareViewDelegate #pragma mark - XCShareViewDelegate