diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index e16782b2..20e29a74 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -212,6 +212,7 @@ 9B86D8802817F4A300494FCD /* XPNobleSettingNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B86D87F2817F4A300494FCD /* XPNobleSettingNavView.m */; }; 9B86D88328192DC000494FCD /* XPRoomRankEntranceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B86D88228192DC000494FCD /* XPRoomRankEntranceView.m */; }; 9B86D886281942D200494FCD /* SocialMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B86D885281942D200494FCD /* SocialMicroView.m */; }; + 9B87B3CD2926473D00085110 /* XPSessionListHeadFriendCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B87B3CC2926473D00085110 /* XPSessionListHeadFriendCell.m */; }; 9B88E20C28C5EB8300D26FBA /* MessageContentRedPacketView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B88E20B28C5EB8300D26FBA /* MessageContentRedPacketView.m */; }; 9B88E20F28C6305400D26FBA /* XPRoomSearchRecordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B88E20E28C6305400D26FBA /* XPRoomSearchRecordViewController.m */; }; 9B88E21228C6365B00D26FBA /* XPHomeSearchRecordCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B88E21128C6365B00D26FBA /* XPHomeSearchRecordCell.m */; }; @@ -294,6 +295,9 @@ 9BD63FAE277EE97A006EB744 /* XPReleaseRadioPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD63FAD277EE97A006EB744 /* XPReleaseRadioPresenter.m */; }; 9BD63FB4277EF1B3006EB744 /* XPReleaseRadioModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD63FB3277EF1B3006EB744 /* XPReleaseRadioModel.m */; }; 9BD6E435289A48E3007DCF42 /* XPNewUserRechargePresentTrasition.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD6E433289A48E3007DCF42 /* XPNewUserRechargePresentTrasition.m */; }; + 9BD798B129262434003E03E6 /* XPSessionListHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD798B029262434003E03E6 /* XPSessionListHeadView.m */; }; + 9BD798B4292632FE003E03E6 /* XPSessionListHeadItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD798B3292632FE003E03E6 /* XPSessionListHeadItemView.m */; }; + 9BD798B72926362F003E03E6 /* XPSessionListHeadItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD798B62926362F003E03E6 /* XPSessionListHeadItem.m */; }; 9BD8D4E328911E9900AE03FF /* XPMineCollectRoomListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8D4E228911E9900AE03FF /* XPMineCollectRoomListViewController.m */; }; 9BD8D4E628911F7700AE03FF /* XPMineCollectRoomListPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8D4E528911F7700AE03FF /* XPMineCollectRoomListPresenter.m */; }; 9BD9A17927A0EC57004186FE /* XPMineVisitorPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD9A17827A0EC57004186FE /* XPMineVisitorPresenter.m */; }; @@ -1641,6 +1645,8 @@ 9B86D88228192DC000494FCD /* XPRoomRankEntranceView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRankEntranceView.m; sourceTree = ""; }; 9B86D884281942D200494FCD /* SocialMicroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SocialMicroView.h; sourceTree = ""; }; 9B86D885281942D200494FCD /* SocialMicroView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SocialMicroView.m; sourceTree = ""; }; + 9B87B3CB2926473D00085110 /* XPSessionListHeadFriendCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionListHeadFriendCell.h; sourceTree = ""; }; + 9B87B3CC2926473D00085110 /* XPSessionListHeadFriendCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionListHeadFriendCell.m; sourceTree = ""; }; 9B88E20A28C5EB8300D26FBA /* MessageContentRedPacketView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageContentRedPacketView.h; sourceTree = ""; }; 9B88E20B28C5EB8300D26FBA /* MessageContentRedPacketView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageContentRedPacketView.m; sourceTree = ""; }; 9B88E20D28C6305400D26FBA /* XPRoomSearchRecordViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomSearchRecordViewController.h; sourceTree = ""; }; @@ -1810,6 +1816,12 @@ 9BD63FB3277EF1B3006EB744 /* XPReleaseRadioModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPReleaseRadioModel.m; sourceTree = ""; }; 9BD6E433289A48E3007DCF42 /* XPNewUserRechargePresentTrasition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPNewUserRechargePresentTrasition.m; sourceTree = ""; }; 9BD6E434289A48E3007DCF42 /* XPNewUserRechargePresentTrasition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNewUserRechargePresentTrasition.h; sourceTree = ""; }; + 9BD798AF29262434003E03E6 /* XPSessionListHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionListHeadView.h; sourceTree = ""; }; + 9BD798B029262434003E03E6 /* XPSessionListHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionListHeadView.m; sourceTree = ""; }; + 9BD798B2292632FE003E03E6 /* XPSessionListHeadItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionListHeadItemView.h; sourceTree = ""; }; + 9BD798B3292632FE003E03E6 /* XPSessionListHeadItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionListHeadItemView.m; sourceTree = ""; }; + 9BD798B52926362F003E03E6 /* XPSessionListHeadItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionListHeadItem.h; sourceTree = ""; }; + 9BD798B62926362F003E03E6 /* XPSessionListHeadItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionListHeadItem.m; sourceTree = ""; }; 9BD8D4E128911E9900AE03FF /* XPMineCollectRoomListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineCollectRoomListViewController.h; sourceTree = ""; }; 9BD8D4E228911E9900AE03FF /* XPMineCollectRoomListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineCollectRoomListViewController.m; sourceTree = ""; }; 9BD8D4E428911F7700AE03FF /* XPMineCollectRoomListPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineCollectRoomListPresenter.h; sourceTree = ""; }; @@ -4220,6 +4232,7 @@ 18F404BC2760989300A6C548 /* View */ = { isa = PBXGroup; children = ( + 9BD798AE29262306003E03E6 /* SessionListHeadView */, E8A30BDB28534667003B4873 /* FindNew */, 18EE3FF72754B01D00A452BF /* NIMViews */, 18EE3FF52754AFD900A452BF /* SessionList */, @@ -5072,6 +5085,21 @@ path = Protocol; sourceTree = ""; }; + 9BD798AE29262306003E03E6 /* SessionListHeadView */ = { + isa = PBXGroup; + children = ( + 9BD798AF29262434003E03E6 /* XPSessionListHeadView.h */, + 9BD798B029262434003E03E6 /* XPSessionListHeadView.m */, + 9BD798B2292632FE003E03E6 /* XPSessionListHeadItemView.h */, + 9BD798B3292632FE003E03E6 /* XPSessionListHeadItemView.m */, + 9BD798B52926362F003E03E6 /* XPSessionListHeadItem.h */, + 9BD798B62926362F003E03E6 /* XPSessionListHeadItem.m */, + 9B87B3CB2926473D00085110 /* XPSessionListHeadFriendCell.h */, + 9B87B3CC2926473D00085110 /* XPSessionListHeadFriendCell.m */, + ); + path = SessionListHeadView; + sourceTree = ""; + }; 9BD9A17D27A0EFB1004186FE /* Visitor */ = { isa = PBXGroup; children = ( @@ -9472,6 +9500,7 @@ E8F9168B27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m in Sources */, E8DEC9A12764A5D20078CB70 /* XPRoomMoreItemModel.m in Sources */, E80EC81028ACD84000D133C5 /* QExtendBoardView.m in Sources */, + 9B87B3CD2926473D00085110 /* XPSessionListHeadFriendCell.m in Sources */, 9B86D88328192DC000494FCD /* XPRoomRankEntranceView.m in Sources */, 18F404B7276095D700A6C548 /* SessionChatLimitView.m in Sources */, E8788942273A55AD00BF1D57 /* XPGiftUsersView.m in Sources */, @@ -9949,6 +9978,7 @@ E824544B26F5BBB800BE8163 /* XPMineModifPayPwdViewController.m in Sources */, E81C1B2227705F950020D1E4 /* Api+ArrangeMic.m in Sources */, E800805A27FD34DE0055A8AB /* XPMineClanViewController.m in Sources */, + 9BD798B4292632FE003E03E6 /* XPSessionListHeadItemView.m in Sources */, E8ACEFF527C8EF0500F66D1A /* XPHomeHotRoomViewController.m in Sources */, E8E20BE828169BDC0033B688 /* XPMineLoginPasswordPresenter.m in Sources */, E81EF6DC279AB5CC00FF3EDE /* XPLittleGameRoomOpenView.m in Sources */, @@ -9975,6 +10005,7 @@ E880B3AF278BE1D800A83B0D /* Api+AcrossRoomPK.m in Sources */, E8B9842D28AB77F10022D026 /* XPMonentsPublishTopicView.m in Sources */, E88C72992828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m in Sources */, + 9BD798B129262434003E03E6 /* XPSessionListHeadView.m in Sources */, E8D34D4728080295009C4835 /* XPMineUserDataViewController.m in Sources */, E801275127E3281100BAC3F2 /* XPRoomPKTimeTableViewCell.m in Sources */, E8EEB90F26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.m in Sources */, @@ -10163,6 +10194,7 @@ 9BAD41AC28C6EB13005E47B3 /* XPInRoomRecordPresenter.m in Sources */, E8AC721626F46B06007D6E91 /* XPMineSettingTableViewCell.m in Sources */, 18EE3FDF2750C1F700A452BF /* SessionListCell.m in Sources */, + 9BD798B72926362F003E03E6 /* XPSessionListHeadItem.m in Sources */, 9BB549622782EA1D0090CD26 /* NobleInfo.m in Sources */, E80487652717DDD9008595F2 /* XPRoomMenuItem.m in Sources */, E895018C282D0701007E459A /* XPMoentsTopicView.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/Contents.json b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/Contents.json b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/Contents.json new file mode 100644 index 00000000..a6a4fbd2 --- /dev/null +++ b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "session_list_head_activity@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "session_list_head_activity@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/session_list_head_activity@2x.png b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/session_list_head_activity@2x.png new file mode 100644 index 00000000..d16ad393 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/session_list_head_activity@2x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/session_list_head_activity@3x.png b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/session_list_head_activity@3x.png new file mode 100644 index 00000000..79ab6007 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_activity.imageset/session_list_head_activity@3x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/Contents.json b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/Contents.json new file mode 100644 index 00000000..a60ee414 --- /dev/null +++ b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "session_list_head_mengxin@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "session_list_head_mengxin@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/session_list_head_mengxin@2x.png b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/session_list_head_mengxin@2x.png new file mode 100644 index 00000000..22893f16 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/session_list_head_mengxin@2x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/session_list_head_mengxin@3x.png b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/session_list_head_mengxin@3x.png new file mode 100644 index 00000000..7bbe0cfb Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_mengxin.imageset/session_list_head_mengxin@3x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/Contents.json b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/Contents.json new file mode 100644 index 00000000..996cd41d --- /dev/null +++ b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "session_list_head_office@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "session_list_head_office@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/session_list_head_office@2x.png b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/session_list_head_office@2x.png new file mode 100644 index 00000000..8e5c164a Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/session_list_head_office@2x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/session_list_head_office@3x.png b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/session_list_head_office@3x.png new file mode 100644 index 00000000..ad7f9634 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_office.imageset/session_list_head_office@3x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/Contents.json b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/Contents.json new file mode 100644 index 00000000..3e8a2cb8 --- /dev/null +++ b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "session_list_head_subscribe@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "session_list_head_subscribe@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/session_list_head_subscribe@2x.png b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/session_list_head_subscribe@2x.png new file mode 100644 index 00000000..d3b54ba5 Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/session_list_head_subscribe@2x.png differ diff --git a/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/session_list_head_subscribe@3x.png b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/session_list_head_subscribe@3x.png new file mode 100644 index 00000000..f783bd6e Binary files /dev/null and b/xplan-ios/Assets.xcassets/SessionMessage/SessionListHead/session_list_head_subscribe.imageset/session_list_head_subscribe@3x.png differ diff --git a/xplan-ios/Main/Message/View/SessionList/SessionListViewController.m b/xplan-ios/Main/Message/View/SessionList/SessionListViewController.m index 3f0244e1..2e6a9f44 100644 --- a/xplan-ios/Main/Message/View/SessionList/SessionListViewController.m +++ b/xplan-ios/Main/Message/View/SessionList/SessionListViewController.m @@ -21,6 +21,7 @@ #import "XPSessionFindNewViewController.h" #import "TTPopUp.h" #import "XPTeenagerHomeView.h" +#import "XPSessionListHeadView.h" NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; @@ -33,6 +34,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; @property (nonatomic,strong) UILabel *titleLabel; @property (nonatomic, strong) UIButton *allReadButton; +@property (nonatomic, strong) XPSessionListHeadView *headView; /** * 会话列表 */ @@ -108,9 +110,9 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; - (void)viewDidLoad { [super viewDidLoad]; - [self getUserInfo]; [self initViews]; [self initLayout]; + [self getUserInfo]; } - (void)getUserInfo { @@ -120,6 +122,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; UserInfoModel * userInfo = [UserInfoModel modelWithDictionary:data.data]; self.userInfo = userInfo; [self.sessionListView reloadData]; + [self.headView updateToolViewWithUserLevel:self.userInfo.userLevelVo.charmLevelSeq]; } } uid:uid]; } @@ -129,6 +132,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; [self.customNavigationBar addSubview:self.titleLabel]; [self.view addSubview:self.customNavigationBar]; [self.customNavigationBar addSubview:self.allReadButton]; + [self.view addSubview:self.headView]; } [self.view addSubview:self.sessionListView]; } @@ -143,12 +147,16 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; make.width.height.mas_equalTo(30); make.centerY.mas_equalTo(self.customNavigationBar); }]; + [self.headView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(0); + make.top.mas_equalTo(self.customNavigationBar.mas_bottom).mas_offset(8); + }]; } [self.sessionListView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.bottom.mas_equalTo(self.view); if (self.openType == SessionListOpenTypeDefault) { - make.top.mas_equalTo(self.customNavigationBar.mas_bottom); + make.top.mas_equalTo(self.headView.mas_bottom); } else { make.top.mas_equalTo(self.view); } @@ -448,4 +456,10 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; return _teenagerView; } +- (XPSessionListHeadView *)headView { + if (!_headView) { + _headView = [[XPSessionListHeadView alloc] init]; + } + return _headView; +} @end diff --git a/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadFriendCell.h b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadFriendCell.h new file mode 100644 index 00000000..a6d0a6ca --- /dev/null +++ b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadFriendCell.h @@ -0,0 +1,16 @@ +// +// XPSessionListHeadFriendCell.h +// xplan-ios +// +// Created by GreenLand on 2022/11/17. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPSessionListHeadFriendCell : UICollectionViewCell + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadFriendCell.m b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadFriendCell.m new file mode 100644 index 00000000..d24477e8 --- /dev/null +++ b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadFriendCell.m @@ -0,0 +1,87 @@ +// +// XPSessionListHeadFriendCell.m +// xplan-ios +// +// Created by GreenLand on 2022/11/17. +// + +#import "XPSessionListHeadFriendCell.h" +#import +#import "ThemeColor.h" + +@interface XPSessionListHeadFriendCell() + +@property (nonatomic, strong) UILabel *nameLabel; +@property (nonatomic, strong) UIImageView *imageView; +@property (nonatomic, strong) UIView *dotView; + +@end + +@implementation XPSessionListHeadFriendCell + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self initView]; + [self initContraints]; + } + return self; +} + +- (void)initView { + [self addSubview:self.imageView]; + [self addSubview:self.nameLabel]; + [self addSubview:self.dotView]; +} + +- (void)initContraints { + [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.centerX.mas_equalTo(0); + make.width.height.mas_equalTo(50); + }]; + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.bottom.mas_equalTo(0); + make.top.mas_equalTo(self.imageView.mas_bottom).mas_offset(8); + make.bottom.mas_equalTo(0); + make.height.mas_equalTo(17); + }]; + [self.dotView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.right.mas_equalTo(self.imageView); + make.width.height.mas_equalTo(8); + }]; +} + +- (void)setTitle:(NSString *)title { + self.nameLabel.text = title; +} + +- (void)setImageName:(NSString *)imageName { + self.imageView.image = [UIImage imageNamed:imageName]; +} + +- (UILabel *)nameLabel { + if (!_nameLabel) { + _nameLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + _nameLabel.backgroundColor = [UIColor clearColor]; + _nameLabel.font = [UIFont systemFontOfSize:14]; + _nameLabel.textColor = ThemeColor.mainTextColor; + } + return _nameLabel; +} + +- (UIImageView *)imageView { + if (!_imageView) { + _imageView = [[UIImageView alloc] init]; + } + return _imageView; +} + +- (UIView *)dotView { + if (!_dotView) { + _dotView = [[UIView alloc] init]; + _dotView.layer.cornerRadius = 4; + _dotView.layer.masksToBounds = YES; + } + return _dotView; +} + +@end diff --git a/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItem.h b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItem.h new file mode 100644 index 00000000..59582e10 --- /dev/null +++ b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItem.h @@ -0,0 +1,28 @@ +// +// XPSessionListHeadItem.h +// xplan-ios +// +// Created by GreenLand on 2022/11/17. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, XPSessionListHeadItemType) { + XPSessionListHeadItemType_Office,//官方公告 + XPSessionListHeadItemType_Activity,//活动通知 + XPSessionListHeadItemType_Subscribe,//订阅提醒 + XPSessionListHeadItemType_MemgXin,//发现萌新 +}; + +@interface XPSessionListHeadItem : NSObject + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) NSString *imageName; +@property (nonatomic, assign) BOOL showRedDot; +@property (nonatomic, assign) XPSessionListHeadItemType type; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItem.m b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItem.m new file mode 100644 index 00000000..ba2b7199 --- /dev/null +++ b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItem.m @@ -0,0 +1,12 @@ +// +// XPSessionListHeadItem.m +// xplan-ios +// +// Created by GreenLand on 2022/11/17. +// + +#import "XPSessionListHeadItem.h" + +@implementation XPSessionListHeadItem + +@end diff --git a/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItemView.h b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItemView.h new file mode 100644 index 00000000..f57f6d75 --- /dev/null +++ b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItemView.h @@ -0,0 +1,20 @@ +// +// XPSessionListHeadItemView.h +// xplan-ios +// +// Created by GreenLand on 2022/11/17. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPSessionListHeadItemView : UIView + +@property (nonatomic, copy) NSString *imageName; +@property (nonatomic, copy) NSString *title; +@property (nonatomic, assign) BOOL showDot; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItemView.m b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItemView.m new file mode 100644 index 00000000..56ed55ab --- /dev/null +++ b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadItemView.m @@ -0,0 +1,87 @@ +// +// XPSessionListHeadItemView.m +// xplan-ios +// +// Created by GreenLand on 2022/11/17. +// + +#import "XPSessionListHeadItemView.h" +#import +#import "ThemeColor.h" + +@interface XPSessionListHeadItemView() + +@property (nonatomic, strong) UILabel *nameLabel; +@property (nonatomic, strong) UIImageView *imageView; +@property (nonatomic, strong) UIView *dotView; + +@end + +@implementation XPSessionListHeadItemView + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self initView]; + [self initContraints]; + } + return self; +} + +- (void)initView { + [self addSubview:self.imageView]; + [self addSubview:self.nameLabel]; + [self addSubview:self.dotView]; +} + +- (void)initContraints { + [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.centerX.mas_equalTo(0); + make.width.height.mas_equalTo(50); + }]; + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.bottom.mas_equalTo(0); + make.top.mas_equalTo(self.imageView.mas_bottom).mas_offset(8); + make.bottom.mas_equalTo(0); + make.height.mas_equalTo(17); + }]; + [self.dotView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.right.mas_equalTo(self.imageView); + make.width.height.mas_equalTo(8); + }]; +} + +- (void)setTitle:(NSString *)title { + self.nameLabel.text = title; +} + +- (void)setImageName:(NSString *)imageName { + self.imageView.image = [UIImage imageNamed:imageName]; +} + +- (UILabel *)nameLabel { + if (!_nameLabel) { + _nameLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + _nameLabel.backgroundColor = [UIColor clearColor]; + _nameLabel.font = [UIFont systemFontOfSize:14]; + _nameLabel.textColor = ThemeColor.mainTextColor; + } + return _nameLabel; +} + +- (UIImageView *)imageView { + if (!_imageView) { + _imageView = [[UIImageView alloc] init]; + } + return _imageView; +} + +- (UIView *)dotView { + if (!_dotView) { + _dotView = [[UIView alloc] init]; + _dotView.layer.cornerRadius = 4; + _dotView.layer.masksToBounds = YES; + } + return _dotView; +} + +@end diff --git a/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadView.h b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadView.h new file mode 100644 index 00000000..1f6c49c2 --- /dev/null +++ b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadView.h @@ -0,0 +1,20 @@ +// +// XPSessionListHeadView.h +// xplan-ios +// +// Created by GreenLand on 2022/11/17. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPSessionListHeadView : UIView + +- (void)updateToolViewWithUserLevel:(NSInteger)level; + +@property (nonatomic, strong) NSArray *friendsArray; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadView.m b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadView.m new file mode 100644 index 00000000..13b46992 --- /dev/null +++ b/xplan-ios/Main/Message/View/SessionListHeadView/XPSessionListHeadView.m @@ -0,0 +1,249 @@ +// +// XPSessionListHeadView.m +// xplan-ios +// +// Created by GreenLand on 2022/11/17. +// + +#import "XPSessionListHeadView.h" +#import +#import "UIImage+Utils.h" +#import "ThemeColor.h" +#import "ClientConfig.h" +#import "UserInfoModel.h" +#import "XPSessionListHeadItem.h" +#import "XPSessionListHeadItemView.h" +#import "XPSessionListHeadFriendCell.h" + +@interface XPSessionListHeadView() + +@property (nonatomic, strong) UIStackView *mainStackView; +///工具条 +@property (nonatomic, strong) UIStackView *toolStackView; +///好友容器 +@property (nonatomic, strong) UIView *friendContentView; +///好友派对view +@property (nonatomic, strong) UIImageView *partyView; +///好友派对中~ +@property (nonatomic, strong) UIButton *partyButton; +///好友列表 +@property (nonatomic, strong) UICollectionView *collectionView; + +///工具item集合 +@property (nonatomic, strong) NSMutableArray *funtionArray; + +@end + +@implementation XPSessionListHeadView + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self initItemData]; + [self initView]; + [self initContraints]; + } + return self; +} + +- (void)initItemData { + XPSessionListHeadItem *officeItem = [[XPSessionListHeadItem alloc] init]; + officeItem.title = @"官方公告"; + officeItem.imageName = @"session_list_head_office"; + officeItem.type = XPSessionListHeadItemType_Office; + + XPSessionListHeadItem *activityItem = [[XPSessionListHeadItem alloc] init]; + activityItem.title = @"活动通知"; + activityItem.imageName = @"session_list_head_activity"; + activityItem.type = XPSessionListHeadItemType_Activity; + + XPSessionListHeadItem *subscribeItem = [[XPSessionListHeadItem alloc] init]; + subscribeItem.title = @"订阅提醒"; + subscribeItem.imageName = @"session_list_head_subscribe"; + subscribeItem.type = XPSessionListHeadItemType_Subscribe; + + [self.funtionArray addObject:officeItem]; + [self.funtionArray addObject:activityItem]; + [self.funtionArray addObject:subscribeItem]; +} + +- (void)initView { + [self addSubview:self.mainStackView]; + [self.mainStackView addArrangedSubview:self.toolStackView]; + [self.mainStackView addArrangedSubview:self.friendContentView]; + for (XPSessionListHeadItem *item in self.funtionArray) { + XPSessionListHeadItemView *itemView = [[XPSessionListHeadItemView alloc] init]; + itemView.imageName = item.imageName; + itemView.title = item.title; + itemView.showDot = item.showRedDot; + itemView.tag = item.type; + [self.toolStackView addArrangedSubview:itemView]; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapItem:)]; + [itemView addGestureRecognizer:tap]; + } + [self.friendContentView addSubview:self.partyView]; + [self.partyView addSubview:self.partyButton]; + [self.friendContentView addSubview:self.collectionView]; + +} + +- (void)initContraints { + [self.mainStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(0); + }]; + [self.partyView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(26); + make.top.mas_equalTo(12); + make.size.mas_equalTo(CGSizeMake(82, 16)); + }]; + [self.partyButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(0); + }]; + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(16); + make.right.mas_equalTo(-16); + make.height.mas_equalTo(82); + make.top.mas_equalTo(self.partyView.mas_bottom); + make.bottom.mas_equalTo(0); + }]; +} + +#pragma mark - UICollectionViewDelegate +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.friendsArray.count; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + XPSessionListHeadFriendCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPSessionListHeadFriendCell class]) forIndexPath:indexPath]; + + return cell; +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + +} + +- (void)updateToolViewWithUserLevel:(NSInteger)level { + if( [ClientConfig shareConfig].configInfo.findNewbieCharmLevel <= level) { + XPSessionListHeadItem *mengxinItem = [[XPSessionListHeadItem alloc] init]; + mengxinItem.title = @"发现萌新"; + mengxinItem.imageName = @"session_list_head_mengxin"; + mengxinItem.type = XPSessionListHeadItemType_MemgXin; + [self.funtionArray addObject:mengxinItem]; + + XPSessionListHeadItemView *itemView = [[XPSessionListHeadItemView alloc] init]; + itemView.imageName = mengxinItem.imageName; + itemView.title = mengxinItem.title; + itemView.showDot = mengxinItem.showRedDot; + itemView.tag = mengxinItem.type; + [self.toolStackView addArrangedSubview:itemView]; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapItem:)]; + [itemView addGestureRecognizer:tap]; + } +} + +- (void)tapItem:(UITapGestureRecognizer *)ges { + XPSessionListHeadItemView *view = (XPSessionListHeadItemView *)ges.view; + switch (view.tag) { + case XPSessionListHeadItemType_Office: + { + + } + break; + case XPSessionListHeadItemType_Activity: + { + + } + break; + case XPSessionListHeadItemType_Subscribe: + { + + } + break; + case XPSessionListHeadItemType_MemgXin: + { + + } + break; + default: + break; + } +} + +- (UIStackView *)mainStackView { + if (!_mainStackView) { + _mainStackView = [[UIStackView alloc] init]; + _mainStackView.axis = UILayoutConstraintAxisVertical; + _mainStackView.distribution = UIStackViewDistributionFill; + _mainStackView.alignment = UIStackViewAlignmentFill; + } + return _mainStackView; +} + +- (UIStackView *)toolStackView { + if (!_toolStackView) { + _toolStackView = [[UIStackView alloc] init]; + _toolStackView.axis = UILayoutConstraintAxisHorizontal; + _toolStackView.distribution = UIStackViewDistributionFillEqually; + _toolStackView.alignment = UIStackViewAlignmentCenter; + } + return _toolStackView; +} + +- (NSMutableArray *)funtionArray { + if (!_funtionArray) { + _funtionArray = [NSMutableArray array]; + } + return _funtionArray; +} +- (UIView *)friendContentView { + if (!_friendContentView) { + _friendContentView = [[UIView alloc] init]; +// _friendContentView.hidden = YES; + } + return _friendContentView; +} + +- (UICollectionView *)collectionView { + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + layout.minimumLineSpacing = 0; + layout.minimumInteritemSpacing = 18; + layout.itemSize = CGSizeMake(48, 68); + layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + [_collectionView registerClass:[XPSessionListHeadFriendCell class] forCellWithReuseIdentifier:NSStringFromClass([XPSessionListHeadFriendCell class])]; + _collectionView.delegate = self; + _collectionView.dataSource = self; + _collectionView.backgroundColor = UIColorRGBAlpha(0x5FCCE4, 0.12); + _collectionView.layer.cornerRadius = 8; + _collectionView.layer.masksToBounds = YES; + } + return _collectionView; +} + +- (UIImageView *)partyView { + if (!_partyView) { + _partyView = [[UIImageView alloc] init]; + _partyView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x70F2F2), UIColorFromRGB(0x4ECDFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(82, 16)]; + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 82, 16) byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(6, 6)]; + CAShapeLayer *maskLayer = [CAShapeLayer layer]; + maskLayer.path = path.CGPath; + _partyView.layer.mask = maskLayer; + } + return _partyView; +} + +- (UIButton *)partyButton { + if (!_partyButton) { + _partyButton = [[UIButton alloc] init]; + [_partyButton setTitle:@"好友派对中~" forState:UIControlStateNormal]; + [_partyButton setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal]; + _partyButton.titleLabel.font = [UIFont systemFontOfSize:10]; + _partyButton.titleLabel.textColor = [ThemeColor mainTextColor]; + + } + return _partyButton; +} + +@end