首页UI更改
14
Podfile
@@ -10,17 +10,19 @@ target 'YuMi' do
|
||||
# 滑动标签栏
|
||||
pod 'JXCategoryView'
|
||||
pod 'JXPagingView/Pager'
|
||||
#模型转化
|
||||
pod 'MJExtension'
|
||||
#图片加载
|
||||
pod 'SDWebImage'
|
||||
#模型转化
|
||||
pod 'MJExtension'
|
||||
#图片加载
|
||||
pod 'SDWebImage'
|
||||
pod 'FLAnimatedImage'
|
||||
pod 'SDWebImageFLPlugin' # 对FLAnimatedImage和SDWebImage的桥接
|
||||
pod 'AFNetworking'
|
||||
#文字自动滚动
|
||||
pod 'MarqueeLabel-ObjC'
|
||||
pod 'YYText'
|
||||
pod 'Masonry'
|
||||
#输入
|
||||
pod 'SZTextView'
|
||||
#输入
|
||||
pod 'SZTextView'
|
||||
#头饰显示
|
||||
pod 'YYWebImage'
|
||||
#轮播图
|
||||
|
@@ -201,7 +201,6 @@
|
||||
237B94C02A984DA7007853E3 /* Api+RoomTrumpet.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B94BA2A984DA7007853E3 /* Api+RoomTrumpet.m */; };
|
||||
23942E912A86424500D0ECC2 /* XPLoginAuthCodeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23942E902A86424500D0ECC2 /* XPLoginAuthCodeVC.m */; };
|
||||
239BEEDB2AA1E058005CDA94 /* PIHoemCategoryTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 239BEEDA2AA1E058005CDA94 /* PIHoemCategoryTitleView.m */; };
|
||||
23A439712AA1CBF3002E6039 /* XPNewHomeItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23A439702AA1CBF3002E6039 /* XPNewHomeItemView.m */; };
|
||||
23A439742AA1CF7C002E6039 /* XPNewHomeHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23A439732AA1CF7C002E6039 /* XPNewHomeHeadView.m */; };
|
||||
23B2AEC12A64E9C200543D17 /* LoginForgetEditView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC02A64E9C200543D17 /* LoginForgetEditView.m */; };
|
||||
23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; };
|
||||
@@ -304,6 +303,13 @@
|
||||
23E9EB252A84E98300B792F2 /* pi_new_mine_info_online.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB232A84E98300B792F2 /* pi_new_mine_info_online.svga */; };
|
||||
23E9EB312A85E5D100B792F2 /* pi_app_logo_new_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */; };
|
||||
23E9EB332A85E97C00B792F2 /* pi_login_new_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */; };
|
||||
23FF42632AA5861E0055733C /* XPNewHomePartyCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF42622AA5861E0055733C /* XPNewHomePartyCollectionViewCell.m */; };
|
||||
23FF42652AA5AC040055733C /* home_heat.gif in Resources */ = {isa = PBXBuildFile; fileRef = 23FF42642AA5AC040055733C /* home_heat.gif */; };
|
||||
23FF42672AA5CFBB0055733C /* home_sound_wave.gif in Resources */ = {isa = PBXBuildFile; fileRef = 23FF42662AA5CFBB0055733C /* home_sound_wave.gif */; };
|
||||
23FF426A2AA5DF050055733C /* XPNewHomePartyTagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF42692AA5DF050055733C /* XPNewHomePartyTagView.m */; };
|
||||
23FF426D2AA5E4EE0055733C /* XPNewHomePartyAudioView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF426C2AA5E4EE0055733C /* XPNewHomePartyAudioView.m */; };
|
||||
23FF42702AA6C7CF0055733C /* XPNewHomeItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF426F2AA6C7CF0055733C /* XPNewHomeItemCell.m */; };
|
||||
23FF42732AA6CC480055733C /* PIHomeItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF42722AA6CC480055733C /* PIHomeItemModel.m */; };
|
||||
73FFADDC93E195344047A2EC /* Pods_YuMi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACF623970097D653132D69A /* Pods_YuMi.framework */; };
|
||||
9B0086C627BA392B0032BD2B /* AnchorStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* AnchorStageView.m */; };
|
||||
9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C927BA4F570032BD2B /* AnchorMicroView.m */; };
|
||||
@@ -1753,8 +1759,6 @@
|
||||
23942E902A86424500D0ECC2 /* XPLoginAuthCodeVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPLoginAuthCodeVC.m; sourceTree = "<group>"; };
|
||||
239BEED92AA1E058005CDA94 /* PIHoemCategoryTitleView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIHoemCategoryTitleView.h; sourceTree = "<group>"; };
|
||||
239BEEDA2AA1E058005CDA94 /* PIHoemCategoryTitleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIHoemCategoryTitleView.m; sourceTree = "<group>"; };
|
||||
23A4396F2AA1CBF3002E6039 /* XPNewHomeItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeItemView.h; sourceTree = "<group>"; };
|
||||
23A439702AA1CBF3002E6039 /* XPNewHomeItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeItemView.m; sourceTree = "<group>"; };
|
||||
23A439722AA1CF7C002E6039 /* XPNewHomeHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeHeadView.h; sourceTree = "<group>"; };
|
||||
23A439732AA1CF7C002E6039 /* XPNewHomeHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeHeadView.m; sourceTree = "<group>"; };
|
||||
23B2AEBF2A64E9C200543D17 /* LoginForgetEditView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginForgetEditView.h; sourceTree = "<group>"; };
|
||||
@@ -1955,6 +1959,18 @@
|
||||
23E9EB232A84E98300B792F2 /* pi_new_mine_info_online.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_new_mine_info_online.svga; sourceTree = "<group>"; };
|
||||
23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_app_logo_new_bg.png; sourceTree = "<group>"; };
|
||||
23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_login_new_logo.png; sourceTree = "<group>"; };
|
||||
23FF42612AA5861E0055733C /* XPNewHomePartyCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomePartyCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
23FF42622AA5861E0055733C /* XPNewHomePartyCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomePartyCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
23FF42642AA5AC040055733C /* home_heat.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = home_heat.gif; sourceTree = "<group>"; };
|
||||
23FF42662AA5CFBB0055733C /* home_sound_wave.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = home_sound_wave.gif; sourceTree = "<group>"; };
|
||||
23FF42682AA5DF050055733C /* XPNewHomePartyTagView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomePartyTagView.h; sourceTree = "<group>"; };
|
||||
23FF42692AA5DF050055733C /* XPNewHomePartyTagView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomePartyTagView.m; sourceTree = "<group>"; };
|
||||
23FF426B2AA5E4EE0055733C /* XPNewHomePartyAudioView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomePartyAudioView.h; sourceTree = "<group>"; };
|
||||
23FF426C2AA5E4EE0055733C /* XPNewHomePartyAudioView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomePartyAudioView.m; sourceTree = "<group>"; };
|
||||
23FF426E2AA6C7CF0055733C /* XPNewHomeItemCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeItemCell.h; sourceTree = "<group>"; };
|
||||
23FF426F2AA6C7CF0055733C /* XPNewHomeItemCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeItemCell.m; sourceTree = "<group>"; };
|
||||
23FF42712AA6CC480055733C /* PIHomeItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIHomeItemModel.h; sourceTree = "<group>"; };
|
||||
23FF42722AA6CC480055733C /* PIHomeItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIHomeItemModel.m; sourceTree = "<group>"; };
|
||||
7DB00EC07F1D0ADFF900B38D /* Pods-YuMi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YuMi.debug.xcconfig"; path = "Target Support Files/Pods-YuMi/Pods-YuMi.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9B0086C427BA392B0032BD2B /* AnchorStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorStageView.h; sourceTree = "<group>"; };
|
||||
9B0086C527BA392B0032BD2B /* AnchorStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorStageView.m; sourceTree = "<group>"; };
|
||||
@@ -8299,6 +8315,8 @@
|
||||
E87DF4CB2A42C960009C1185 /* HomeBannerInfoModel.m */,
|
||||
E87DF4BD2A42C8C1009C1185 /* HomeTagModel.h */,
|
||||
E87DF4BE2A42C8C1009C1185 /* HomeTagModel.m */,
|
||||
23FF42712AA6CC480055733C /* PIHomeItemModel.h */,
|
||||
23FF42722AA6CC480055733C /* PIHomeItemModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -8312,8 +8330,8 @@
|
||||
E87DF4C12A42C900009C1185 /* XPNoteView.m */,
|
||||
E87E62612A3F5689002F68C9 /* XPNewHomeNavView.h */,
|
||||
E87E62602A3F5689002F68C9 /* XPNewHomeNavView.m */,
|
||||
23A4396F2AA1CBF3002E6039 /* XPNewHomeItemView.h */,
|
||||
23A439702AA1CBF3002E6039 /* XPNewHomeItemView.m */,
|
||||
23FF426E2AA6C7CF0055733C /* XPNewHomeItemCell.h */,
|
||||
23FF426F2AA6C7CF0055733C /* XPNewHomeItemCell.m */,
|
||||
23A439722AA1CF7C002E6039 /* XPNewHomeHeadView.h */,
|
||||
23A439732AA1CF7C002E6039 /* XPNewHomeHeadView.m */,
|
||||
);
|
||||
@@ -8329,12 +8347,18 @@
|
||||
E87E626A2A3F5906002F68C9 /* XPHomeBannerTableViewCell.m */,
|
||||
E87E626E2A3F5906002F68C9 /* XPNewHomePartyTableViewCell.h */,
|
||||
E87E62712A3F5907002F68C9 /* XPNewHomePartyTableViewCell.m */,
|
||||
23FF42682AA5DF050055733C /* XPNewHomePartyTagView.h */,
|
||||
23FF42692AA5DF050055733C /* XPNewHomePartyTagView.m */,
|
||||
23FF426B2AA5E4EE0055733C /* XPNewHomePartyAudioView.h */,
|
||||
23FF426C2AA5E4EE0055733C /* XPNewHomePartyAudioView.m */,
|
||||
E87E626B2A3F5906002F68C9 /* XPNewHomePlayEmptyTableViewCell.h */,
|
||||
E87E626D2A3F5906002F68C9 /* XPNewHomePlayEmptyTableViewCell.m */,
|
||||
E87E626C2A3F5906002F68C9 /* XPNewHomePlayTableViewCell.h */,
|
||||
E87E626F2A3F5906002F68C9 /* XPNewHomePlayTableViewCell.m */,
|
||||
E87E62732A3F5907002F68C9 /* XPNewHomeRecommendTableViewCell.h */,
|
||||
E87E62702A3F5907002F68C9 /* XPNewHomeRecommendTableViewCell.m */,
|
||||
23FF42612AA5861E0055733C /* XPNewHomePartyCollectionViewCell.h */,
|
||||
23FF42622AA5861E0055733C /* XPNewHomePartyCollectionViewCell.m */,
|
||||
);
|
||||
path = Cell;
|
||||
sourceTree = "<group>";
|
||||
@@ -8665,6 +8689,8 @@
|
||||
E8A1E45C276220B100B294CA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23FF42642AA5AC040055733C /* home_heat.gif */,
|
||||
23FF42662AA5CFBB0055733C /* home_sound_wave.gif */,
|
||||
23E9EB232A84E98300B792F2 /* pi_new_mine_info_online.svga */,
|
||||
23E9EB222A84E98300B792F2 /* pi_new_mine_info_sound_play.svga */,
|
||||
23E9EAA22A84C80300B792F2 /* pi_new_loading.svga */,
|
||||
@@ -9886,6 +9912,7 @@
|
||||
E80EC83228ACD84000D133C5 /* emoji_00@2x.png in Resources */,
|
||||
E80EC89C28ACD84000D133C5 /* emoji_50@2x.png in Resources */,
|
||||
E80EC87A28ACD84000D133C5 /* emoji_113@2x.png in Resources */,
|
||||
23FF42672AA5CFBB0055733C /* home_sound_wave.gif in Resources */,
|
||||
E80EC88A28ACD84000D133C5 /* emoji_25@2x.png in Resources */,
|
||||
E80EC87828ACD84000D133C5 /* emoji_135@2x.png in Resources */,
|
||||
E80EC8AD28ACD84100D133C5 /* emoji_07@2x.png in Resources */,
|
||||
@@ -9917,6 +9944,7 @@
|
||||
E80EC89F28ACD84000D133C5 /* emoji_66@2x.png in Resources */,
|
||||
E80EC87128ACD84000D133C5 /* emoji_160@2x.png in Resources */,
|
||||
23E9EB252A84E98300B792F2 /* pi_new_mine_info_online.svga in Resources */,
|
||||
23FF42652AA5AC040055733C /* home_heat.gif in Resources */,
|
||||
E80EC86D28ACD84000D133C5 /* emoji_35@2x.png in Resources */,
|
||||
E80EC86528ACD84000D133C5 /* emoji_03@2x.png in Resources */,
|
||||
E80EC85B28ACD84000D133C5 /* emoji_69@2x.png in Resources */,
|
||||
@@ -10269,6 +10297,7 @@
|
||||
E8998D7A2859784200C68558 /* XPSVGAPlayer.m in Sources */,
|
||||
9BD9A18427A0F128004186FE /* XPMineVisitorItemModel.m in Sources */,
|
||||
E852D73E28631C18001465ED /* XPMonentsCommentTableViewCell.m in Sources */,
|
||||
23FF426A2AA5DF050055733C /* XPNewHomePartyTagView.m in Sources */,
|
||||
E85E7BA22A4EC99300B6D00A /* XPMineGiveDiamondSearchModel.m in Sources */,
|
||||
1427219829A75F6F00C7C423 /* HTTPServer.m in Sources */,
|
||||
E80B0712280D0A6700A79F63 /* FansInfoModel.m in Sources */,
|
||||
@@ -10296,6 +10325,7 @@
|
||||
E86596512701A1C000846EBD /* StatisticsService.m in Sources */,
|
||||
E824544026F58F9400BE8163 /* XPMinePayPwdViewController.m in Sources */,
|
||||
9BE01AED2893D0DF00B50299 /* XPDressShopSearchTableViewCell.m in Sources */,
|
||||
23FF42732AA6CC480055733C /* PIHomeItemModel.m in Sources */,
|
||||
E81060F12987C52B00B772F0 /* MessageGuildModel.m in Sources */,
|
||||
E87E62772A3F5907002F68C9 /* XPNewHomeRecommendTableViewCell.m in Sources */,
|
||||
9BA812D228BF145700783EA7 /* ClientRedPacketModel.m in Sources */,
|
||||
@@ -10398,6 +10428,7 @@
|
||||
E80DE4102775C34E00BE5BCB /* XPFirstRechargeSuccessView.m in Sources */,
|
||||
E8412FB32779E285006E1101 /* Api+RoomSetting.m in Sources */,
|
||||
9B2F72D028E45A480000E4FA /* XPRoomQuickMessageContainView.m in Sources */,
|
||||
23FF426D2AA5E4EE0055733C /* XPNewHomePartyAudioView.m in Sources */,
|
||||
E81060E82987720F00B772F0 /* MessageUnSupportModel.m in Sources */,
|
||||
E8D34D6028082BA5009C4835 /* XPMineUserDataPresenter.m in Sources */,
|
||||
E84CBCE4284372D800D43221 /* XPRoomHalfMessageView.m in Sources */,
|
||||
@@ -10476,6 +10507,7 @@
|
||||
E8AC721326F46ADD007D6E91 /* XPMineSettingViewController.m in Sources */,
|
||||
18E7B32126F098650064BC9B /* UserInfoSkillVo.m in Sources */,
|
||||
E8AC722726F482A4007D6E91 /* XPMineFeedbackPresenter.m in Sources */,
|
||||
23FF42632AA5861E0055733C /* XPNewHomePartyCollectionViewCell.m in Sources */,
|
||||
E85E7B422A4EB0D300B6D00A /* XPMinePromptWindow.m in Sources */,
|
||||
14EB640929A5BDDD00A4A00B /* XPMomentsSimpleDetailViewController.m in Sources */,
|
||||
18AAF3F0279EA59300CD7DAD /* MessageContentTextClickable.m in Sources */,
|
||||
@@ -10759,7 +10791,6 @@
|
||||
E84150C527747E0900A7F548 /* FirstRechargeRewardModel.m in Sources */,
|
||||
E8B9843328ABA2FF0022D026 /* MonentsPicResInfo.m in Sources */,
|
||||
9BE9F10227FEE5C200667200 /* XPAnchorFansTaskDetailModel.m in Sources */,
|
||||
23A439712AA1CBF3002E6039 /* XPNewHomeItemView.m in Sources */,
|
||||
E8E0DAE6285C280E00566A2F /* XPSessionFindNewAlertView.m in Sources */,
|
||||
E85E7B1A2A4EB0D200B6D00A /* XPMineGoldIncomeRecordVC.m in Sources */,
|
||||
E86596542701A55500846EBD /* StatisticsServiceHelper.m in Sources */,
|
||||
@@ -10852,6 +10883,7 @@
|
||||
E8F63CBB298B648300B338BA /* SessionSayHelloListModel.m in Sources */,
|
||||
9B1B729828002147003FACE9 /* XPMineFansTeamPresenter.m in Sources */,
|
||||
E85E7B1E2A4EB0D200B6D00A /* XPMineAnchorIncomeStatisViewController.m in Sources */,
|
||||
23FF42702AA6C7CF0055733C /* XPNewHomeItemCell.m in Sources */,
|
||||
E87DF4DA2A42C9D9009C1185 /* HomeCollectRoomModel.m in Sources */,
|
||||
E86507E8281A8212006951B0 /* ContentTweetModel.m in Sources */,
|
||||
E8D55CA0281186D6006935A5 /* SessionAudioRecordView.m in Sources */,
|
||||
|
@@ -5,12 +5,12 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_head_love_bg@2x.png",
|
||||
"filename" : "_home_game_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_head_love_bg@3x.png",
|
||||
"filename" : "_home_game_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/_home_game_bg.imageset/_home_game_bg@2x.png
vendored
Normal file
After Width: | Height: | Size: 840 B |
BIN
YuMi/Assets.xcassets/low/newhome/_home_game_bg.imageset/_home_game_bg@3x.png
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
@@ -5,12 +5,12 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_head_friend_bg@2x.png",
|
||||
"filename" : "_home_game_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_head_friend_bg@3x.png",
|
||||
"filename" : "_home_game_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/_home_game_icon.imageset/_home_game_icon@2x.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
YuMi/Assets.xcassets/low/newhome/_home_game_icon.imageset/_home_game_icon@3x.png
vendored
Normal file
After Width: | Height: | Size: 3.3 KiB |
@@ -5,12 +5,12 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_play_male_border@2x.png",
|
||||
"filename" : "home_age_boy_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_play_male_border@3x.png",
|
||||
"filename" : "home_age_boy_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_age_boy_icon.imageset/home_age_boy_icon@2x.png
vendored
Normal file
After Width: | Height: | Size: 396 B |
BIN
YuMi/Assets.xcassets/low/newhome/home_age_boy_icon.imageset/home_age_boy_icon@3x.png
vendored
Normal file
After Width: | Height: | Size: 520 B |
@@ -5,12 +5,12 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_play_female_border@2x.png",
|
||||
"filename" : "home_age_girl_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_play_female_border@3x.png",
|
||||
"filename" : "home_age_girl_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_age_girl_icon.imageset/home_age_girl_icon@2x.png
vendored
Normal file
After Width: | Height: | Size: 396 B |
BIN
YuMi/Assets.xcassets/low/newhome/home_age_girl_icon.imageset/home_age_girl_icon@3x.png
vendored
Normal file
After Width: | Height: | Size: 515 B |
22
YuMi/Assets.xcassets/low/newhome/home_audio_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_audio_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_audio_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_audio_icon.imageset/home_audio_icon@2x.png
vendored
Normal file
After Width: | Height: | Size: 582 B |
BIN
YuMi/Assets.xcassets/low/newhome/home_audio_icon.imageset/home_audio_icon@3x.png
vendored
Normal file
After Width: | Height: | Size: 937 B |
22
YuMi/Assets.xcassets/low/newhome/home_audio_play_play.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_audio_play_play@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_audio_play_play@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_audio_play_play.imageset/home_audio_play_play@2x.png
vendored
Normal file
After Width: | Height: | Size: 656 B |
BIN
YuMi/Assets.xcassets/low/newhome/home_audio_play_play.imageset/home_audio_play_play@3x.png
vendored
Normal file
After Width: | Height: | Size: 1.1 KiB |
22
YuMi/Assets.xcassets/low/newhome/home_friend_shadow_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_friend_shadow_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_friend_shadow_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_friend_shadow_bg.imageset/home_friend_shadow_bg@2x.png
vendored
Normal file
After Width: | Height: | Size: 789 B |
BIN
YuMi/Assets.xcassets/low/newhome/home_friend_shadow_bg.imageset/home_friend_shadow_bg@3x.png
vendored
Normal file
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 25 KiB |
22
YuMi/Assets.xcassets/low/newhome/home_hour_no_1.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_hour_no_1@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_hour_no_1@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_hour_no_1.imageset/home_hour_no_1@2x.png
vendored
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
YuMi/Assets.xcassets/low/newhome/home_hour_no_1.imageset/home_hour_no_1@3x.png
vendored
Normal file
After Width: | Height: | Size: 14 KiB |
22
YuMi/Assets.xcassets/low/newhome/home_palying_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_palying_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_palying_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_palying_bg.imageset/home_palying_bg@2x.png
vendored
Normal file
After Width: | Height: | Size: 853 B |
BIN
YuMi/Assets.xcassets/low/newhome/home_palying_bg.imageset/home_palying_bg@3x.png
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
22
YuMi/Assets.xcassets/low/newhome/home_palying_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_palying_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_palying_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_palying_icon.imageset/home_palying_icon@2x.png
vendored
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
YuMi/Assets.xcassets/low/newhome/home_palying_icon.imageset/home_palying_icon@3x.png
vendored
Normal file
After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.8 KiB |
22
YuMi/Assets.xcassets/low/newhome/home_week_no_1.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_week_no_1@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "home_week_no_1@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/low/newhome/home_week_no_1.imageset/home_week_no_1@2x.png
vendored
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
YuMi/Assets.xcassets/low/newhome/home_week_no_1.imageset/home_week_no_1@3x.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
@@ -114,7 +114,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param complection 完成
|
||||
/// @param uid 用户的uid
|
||||
+ (void)onceLookAnchorRoomComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid;
|
||||
|
||||
///首页改版资源位
|
||||
+(void)requestCurrentResourceListComplection:(HttpRequestHelperCompletion)complection;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -142,5 +142,8 @@
|
||||
+ (void)onceLookAnchorRoomComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid {
|
||||
[self makeRequest:@"single/broadcast/onceLook" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, nil];
|
||||
}
|
||||
|
||||
///首页改版资源位
|
||||
+(void)requestCurrentResourceListComplection:(HttpRequestHelperCompletion)complection{
|
||||
[self makeRequest:@"home/currentResource" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, nil];
|
||||
}
|
||||
@end
|
||||
|
@@ -11,6 +11,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class HomePlayMicUserModel;
|
||||
@interface HomePlayRoomModel : NSObject
|
||||
@property(nonatomic,assign) CGFloat width;
|
||||
///头像
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
///是否在跨房PK中
|
||||
|
@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,copy) NSString *tid;
|
||||
///名字
|
||||
@property (nonatomic,copy) NSString *name;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
36
YuMi/Modules/YMNewHome/Model/PIHomeItemModel.h
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// PIHomeItemModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef NS_ENUM(NSInteger, HomeMenuResourceType) {
|
||||
///进入牌照房
|
||||
HomeMenuResourceType_Room_Licnese = 1,
|
||||
///进入相亲房
|
||||
HomeMenuResourceType_Room_Dating,
|
||||
///进入PK房
|
||||
HomeMenuResourceType_Room_PK,
|
||||
///进入Game房
|
||||
HomeMenuResourceType_Room_Game,
|
||||
///进入H5
|
||||
HomeMenuResourceType_H5,
|
||||
///进入自定义房
|
||||
HomeMenuResourceType_Room_Custom,
|
||||
///一键匹配
|
||||
HomeMenuResourceType_Match = 8,
|
||||
};
|
||||
@interface PIHomeItemModel : NSObject
|
||||
///id
|
||||
@property (nonatomic,copy) NSString *ID;
|
||||
@property(nonatomic,copy) NSString *icon;
|
||||
@property(nonatomic,copy) NSString *resourceContent;
|
||||
@property(nonatomic,copy) NSString *posSeq;
|
||||
@property(nonatomic,assign) HomeMenuResourceType resourceType;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
15
YuMi/Modules/YMNewHome/Model/PIHomeItemModel.m
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// PIHomeItemModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/5.
|
||||
//
|
||||
|
||||
#import "PIHomeItemModel.h"
|
||||
|
||||
@implementation PIHomeItemModel
|
||||
+ (NSDictionary *)replacedKeyFromPropertyName {
|
||||
return @{@"ID":@"id"};
|
||||
}
|
||||
|
||||
@end
|
@@ -14,7 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getHomeTopBannerList;
|
||||
/// 获取所有的房间的tag
|
||||
- (void)getHomeTagList;
|
||||
|
||||
///首页改版资源位
|
||||
-(void)getCurrentResourceList;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#import "XPHomeContainerProtocol.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "HomeBannerInfoModel.h"
|
||||
#import "PIHomeItemModel.h"
|
||||
@implementation XPHomeContainerPresenter
|
||||
///得到首页轮播图
|
||||
- (void)getHomeTopBannerList{
|
||||
@@ -38,5 +39,11 @@
|
||||
}
|
||||
}] uid:uid];
|
||||
}
|
||||
|
||||
///首页改版资源位
|
||||
-(void)getCurrentResourceList{
|
||||
[Api requestCurrentResourceListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray *list = [PIHomeItemModel modelsWithArray:data.data];
|
||||
[[self getView]getCurrentResourceListSuccess:list];
|
||||
}]];
|
||||
}
|
||||
@end
|
||||
|
@@ -20,7 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// 获取更多的个播房间
|
||||
- (void)getHomeMoreAnchorRoomList;
|
||||
|
||||
/// 热门房间(个人房)列表
|
||||
- (void)getHomePersonalRoomList;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#import "HomeRecommendRoomModel.h"
|
||||
///P
|
||||
#import "XPHomeProtocol.h"
|
||||
#import "HomePlayRoomModel.h"
|
||||
@implementation XPHomePresenter
|
||||
|
||||
|
||||
@@ -40,5 +41,13 @@
|
||||
[[self getView] getHomeMoreAnchorRoomListFail:msg];
|
||||
}] singleRoomSortId:@""];
|
||||
}
|
||||
|
||||
/// 热门房间(个人房)列表
|
||||
- (void)getHomePersonalRoomList{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api homePersonalRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray * array = [HomePlayRoomModel modelsWithArray:data.data];
|
||||
[[self getView] getHomePersonalRoomListSuccess:array ];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
}errorToast:NO] uid:uid];
|
||||
}
|
||||
@end
|
||||
|
@@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getHomeTagListSuccess:(NSArray<HomeTagModel *> *)array;
|
||||
///获取首页轮播图列表成功
|
||||
- (void)getHomeTopBannerListSuccess:(NSArray*)list;
|
||||
|
||||
////首页改版资源位
|
||||
-(void)getCurrentResourceListSuccess:(NSArray *)list;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getHomeMoreAnchorRoomListSuccess:(NSArray *)list;
|
||||
///请求更多个播房失败
|
||||
- (void)getHomeMoreAnchorRoomListFail:(NSString *)messag;
|
||||
///获取个人房列表成功
|
||||
- (void)getHomePersonalRoomListSuccess:(NSArray *)list;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
16
YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyAudioView.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPNewHomePartyAudioView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/4.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPNewHomePartyAudioView : UIView
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
80
YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyAudioView.m
Normal file
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// XPNewHomePartyAudioView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/4.
|
||||
//
|
||||
|
||||
#import "XPNewHomePartyAudioView.h"
|
||||
@interface XPNewHomePartyAudioView ()
|
||||
///背景
|
||||
@property(nonatomic,strong) UIView *bgView;
|
||||
///签名
|
||||
@property(nonatomic,strong) UILabel *signatureView;
|
||||
///播放按钮
|
||||
@property(nonatomic,strong) UIButton *playBnt;
|
||||
///图标
|
||||
@property(nonatomic,strong) UIImageView *audioBgView;
|
||||
///时间
|
||||
@property(nonatomic,strong) UILabel *timeView;
|
||||
@end
|
||||
@implementation XPNewHomePartyAudioView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.bgView];
|
||||
[self.bgView addSubview:self.signatureView];
|
||||
[self.bgView addSubview:self.playBnt];
|
||||
[self.bgView addSubview:self.audioBgView];
|
||||
[self.bgView addSubview:self.timeView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UIView *)bgView{
|
||||
if(!_bgView){
|
||||
_bgView = [UIView new];
|
||||
_bgView.backgroundColor = UIColorFromRGB(0xF5F6FA);
|
||||
_bgView.layer.cornerRadius = kGetScaleWidth(26)/2;
|
||||
_bgView.layer.masksToBounds = YES;
|
||||
UIView *subView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 20, kGetScaleWidth(13))];
|
||||
[_bgView addSubview:subView];
|
||||
[subView setCornerWithLeftTopCorner:kGetScaleWidth(2) rightTopCorner:0 bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(20, kGetScaleWidth(12))];
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
- (UILabel *)signatureView{
|
||||
if(!_signatureView){
|
||||
_signatureView = [UILabel labelInitWithText:@"" font:kFontRegular(10) textColor:UIColorFromRGB(0x8A8CAB)];
|
||||
}
|
||||
return _signatureView;
|
||||
}
|
||||
- (UIButton *)playBnt{
|
||||
if(!_playBnt){
|
||||
_playBnt = [UIButton new];
|
||||
[_playBnt setImage:kImage(@"home_audio_play_play") forState:UIControlStateNormal];
|
||||
}
|
||||
return _playBnt;
|
||||
}
|
||||
- (UIImageView *)audioBgView{
|
||||
if(!_audioBgView){
|
||||
_audioBgView = [UIImageView new];
|
||||
_audioBgView.image = kImage(@"home_audio_icon");
|
||||
}
|
||||
return _audioBgView;
|
||||
}
|
||||
- (UILabel *)timeView{
|
||||
if(!_timeView){
|
||||
_timeView = [UILabel labelInitWithText:@"0\"" font:kFontMedium(12) textColor:UIColorFromRGB(0x1F1B4F)];
|
||||
}
|
||||
return _timeView;
|
||||
}
|
||||
@end
|
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// XPNewHomePartyCollectionViewCell.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/4.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "HomePlayRoomModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class HomePlayRoomModel, HomeRecommendRoomModel;
|
||||
@interface XPNewHomePartyCollectionViewCell : UICollectionViewCell
|
||||
@property (nonatomic,strong) HomePlayRoomModel *roomInfo;
|
||||
@property (nonatomic,strong) HomeRecommendRoomModel *roomInfo1;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,184 @@
|
||||
//
|
||||
// XPNewHomePartyCollectionViewCell.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/4.
|
||||
//
|
||||
|
||||
#import "XPNewHomePartyCollectionViewCell.h"
|
||||
#import <SDWebImageFLPlugin/SDWebImageFLPlugin.h>
|
||||
@interface XPNewHomePartyCollectionViewCell()
|
||||
///背景
|
||||
@property(nonatomic,strong) NetImageView *bgImageView;
|
||||
///阴影
|
||||
@property(nonatomic,strong) UIImageView *shadowBgView;
|
||||
///榜单
|
||||
@property(nonatomic,strong) UIImageView *rankImageView;
|
||||
///类型
|
||||
@property(nonatomic,strong) NetImageView *tagBgImageView;
|
||||
|
||||
///房间名
|
||||
@property(nonatomic,strong) UILabel *nameView;
|
||||
///热度
|
||||
@property(nonatomic,strong) UILabel *heatView;
|
||||
///热度波浪
|
||||
@property(nonatomic,strong) FLAnimatedImageView *heatGifView;
|
||||
@end
|
||||
@implementation XPNewHomePartyCollectionViewCell
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
for (int i = 0; i < 5; i++) {
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
NetImageView *iconView = [[NetImageView alloc]initWithConfig:config];
|
||||
iconView.tag = 100 + i;
|
||||
iconView.layer.cornerRadius = kGetScaleWidth(18)/2;
|
||||
iconView.layer.masksToBounds = YES;
|
||||
iconView.layer.borderWidth = 1;
|
||||
iconView.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
iconView.hidden = YES;
|
||||
[self.bgImageView addSubview:iconView];
|
||||
CGFloat left = kGetScaleWidth(8) + i * kGetScaleWidth(12);
|
||||
[iconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(self.nameView.mas_top).mas_offset(-kGetScaleWidth(2));
|
||||
make.leading.mas_equalTo(left);
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(18));
|
||||
}];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self.contentView addSubview:self.bgImageView];
|
||||
[self.bgImageView addSubview:self.shadowBgView];
|
||||
[self.contentView addSubview:self.rankImageView];
|
||||
[self.bgImageView addSubview:self.tagBgImageView];
|
||||
[self.bgImageView addSubview:self.nameView];
|
||||
[self.bgImageView addSubview:self.heatGifView];
|
||||
[self.bgImageView addSubview:self.heatView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(170));
|
||||
make.height.mas_equalTo(kGetScaleWidth(174));
|
||||
make.center.equalTo(self.contentView);
|
||||
}];
|
||||
[self.shadowBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.bgImageView);
|
||||
}];
|
||||
[self.rankImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
||||
make.top.left.equalTo(self.contentView);
|
||||
make.width.mas_equalTo(kGetScaleWidth(174));
|
||||
make.height.mas_equalTo(kGetScaleWidth(178));
|
||||
}];
|
||||
[self.tagBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.mas_equalTo(kGetScaleWidth(6));
|
||||
make.width.mas_equalTo(kGetScaleWidth(46));
|
||||
make.height.mas_equalTo(kGetScaleWidth(20));
|
||||
}];
|
||||
[self.heatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(12));
|
||||
make.bottom.mas_equalTo(-kGetScaleWidth(12));
|
||||
make.height.mas_equalTo(kGetScaleWidth(12));
|
||||
make.width.mas_equalTo(kGetScaleWidth(17));
|
||||
}];
|
||||
|
||||
|
||||
[self.heatGifView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(10));
|
||||
make.height.mas_equalTo(kGetScaleWidth(9));
|
||||
make.trailing.equalTo(self.heatView.mas_leading).mas_offset(-kGetScaleWidth(2));
|
||||
make.centerY.equalTo(self.heatView);
|
||||
}];
|
||||
[self.nameView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(8));
|
||||
make.bottom.mas_equalTo(-kGetScaleWidth(10));
|
||||
make.trailing.equalTo(self.heatGifView.mas_leading).mas_equalTo(0);
|
||||
make.height.mas_equalTo(kGetScaleWidth(20));
|
||||
|
||||
}];
|
||||
}
|
||||
- (void)setRoomInfo:(HomePlayRoomModel *)roomInfo{
|
||||
_roomInfo = roomInfo;
|
||||
_nameView.text = _roomInfo.title;
|
||||
_bgImageView.imageUrl = _roomInfo.avatar;
|
||||
_tagBgImageView.imageUrl = _roomInfo.tagPict;
|
||||
_heatView.text = @(_roomInfo.onlineNum).stringValue;
|
||||
if(_rankImageView.image == nil){
|
||||
_rankImageView.image = kImage(@"home_hour_no_1");
|
||||
}else{
|
||||
_rankImageView.image = kImage(@"home_week_no_1");
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
NetImageView *iconView = [self.bgImageView viewWithTag:100 + i];
|
||||
if(i < _roomInfo.micUsers.count){
|
||||
iconView.hidden = NO;
|
||||
HomePlayMicUserModel *playModel = _roomInfo.micUsers[i];
|
||||
iconView.imageUrl = playModel.avatar;
|
||||
}else{
|
||||
iconView.hidden = YES;
|
||||
}
|
||||
}
|
||||
[self.heatView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(self.roomInfo.width);
|
||||
}];
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (NetImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = [UIImageConstant defalutEmptyPlaceholder];
|
||||
_bgImageView = [[NetImageView alloc]initWithConfig:config];
|
||||
[_bgImageView setCornerWithLeftTopCorner:kGetScaleWidth(14) rightTopCorner:kGetScaleWidth(14) bottomLeftCorner:kGetScaleWidth(15) bottomRightCorner:kGetScaleWidth(14) size:CGSizeMake(kGetScaleWidth(170), kGetScaleWidth(174))];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
- (UIImageView *)rankImageView{
|
||||
if(!_rankImageView){
|
||||
_rankImageView = [UIImageView new];
|
||||
}
|
||||
return _rankImageView;
|
||||
}
|
||||
- (NetImageView *)tagBgImageView{
|
||||
if(!_tagBgImageView){
|
||||
_tagBgImageView = [NetImageView new];
|
||||
}
|
||||
return _tagBgImageView;
|
||||
}
|
||||
- (UILabel *)nameView{
|
||||
if(!_nameView){
|
||||
_nameView = [UILabel labelInitWithText:@"" font:kFontMedium(14) textColor:[UIColor whiteColor]];
|
||||
}
|
||||
return _nameView;
|
||||
}
|
||||
-(UILabel *)heatView{
|
||||
if(!_heatView){
|
||||
_heatView = [UILabel labelInitWithText:@"0" font:kFontBold(10) textColor:[UIColor whiteColor]];
|
||||
_heatView.textAlignment = NSTextAlignmentRight;
|
||||
}
|
||||
return _heatView;
|
||||
}
|
||||
- (FLAnimatedImageView *)heatGifView{
|
||||
if(!_heatGifView){
|
||||
_heatGifView = [FLAnimatedImageView new];
|
||||
NSData *localData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"home_heat.gif" ofType:nil]];
|
||||
FLAnimatedImage *animatedImage = [FLAnimatedImage animatedImageWithGIFData:localData];
|
||||
_heatGifView.animatedImage = animatedImage;
|
||||
|
||||
}
|
||||
return _heatGifView;
|
||||
}
|
||||
- (UIImageView *)shadowBgView{
|
||||
if(!_shadowBgView){
|
||||
_shadowBgView = [UIImageView new];
|
||||
_shadowBgView.image = kImage(@"home_friend_shadow_bg");
|
||||
}
|
||||
return _shadowBgView;
|
||||
}
|
||||
|
||||
@end
|
@@ -15,27 +15,39 @@
|
||||
#import "HomePlayRoomModel.h"
|
||||
#import "HomeRecommendRoomModel.h"
|
||||
|
||||
|
||||
#import "XPNewHomePartyTagView.h"
|
||||
#import "XPNewHomePartyAudioView.h"
|
||||
|
||||
|
||||
@interface XPNewHomePartyTableViewCell ()
|
||||
///正在pk的
|
||||
@property (nonatomic,strong) UIImageView *crossPkImageView;
|
||||
///容器
|
||||
@property(nonatomic,strong) UIStackView *stackView;
|
||||
///头像
|
||||
@property (nonatomic,strong) NetImageView *avatarImageView;
|
||||
///背景
|
||||
@property (nonatomic,strong) UIView *bgView;
|
||||
///房间标题
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///tag
|
||||
@property (nonatomic,strong) NetImageView *tagImageView;
|
||||
///id
|
||||
@property (nonatomic,strong) UILabel *idLabel;
|
||||
///个数的logo
|
||||
@property (nonatomic,strong) UIImageView *numberImageView;
|
||||
///显示个数
|
||||
@property (nonatomic,strong) UILabel *numberLabel;
|
||||
|
||||
///标签
|
||||
@property(nonatomic,strong) XPNewHomePartyTagView *tagView;
|
||||
///小绿点
|
||||
@property(nonatomic,strong) UIView *greenView;
|
||||
///边框
|
||||
@property (nonatomic,strong) UIImageView *borderImageView;
|
||||
///游戏背景
|
||||
@property(nonatomic,strong) UIImageView *gameBgView;
|
||||
///游戏图标
|
||||
@property(nonatomic,strong) UIImageView *gameIconView;
|
||||
///声音、签名
|
||||
@property(nonatomic,strong) XPNewHomePartyAudioView *audioView;
|
||||
///聊天
|
||||
@property(nonatomic,strong) UIButton *chatBtn;
|
||||
///生日
|
||||
@property(nonatomic,strong) UIButton *birthdayView;
|
||||
///财富
|
||||
@property(nonatomic,strong) NetImageView *wealthView;
|
||||
///魅力
|
||||
@property(nonatomic,strong) NetImageView *charmView;
|
||||
@end
|
||||
|
||||
@implementation XPNewHomePartyTableViewCell
|
||||
@@ -53,125 +65,117 @@
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self.contentView addSubview:self.bgView];
|
||||
[self.contentView addSubview:self.avatarImageView];
|
||||
[self.contentView addSubview:self.crossPkImageView];
|
||||
[self.bgView addSubview:self.borderImageView];
|
||||
[self.bgView addSubview:self.avatarImageView];
|
||||
[self.bgView addSubview:self.gameBgView];
|
||||
[self.bgView addSubview:self.gameIconView];
|
||||
[self.bgView addSubview:self.greenView];
|
||||
[self.bgView addSubview:self.stackView];
|
||||
|
||||
|
||||
|
||||
[self.bgView addSubview:self.tagView];
|
||||
[self.bgView addSubview:self.audioView];
|
||||
[self.bgView addSubview:self.chatBtn];
|
||||
|
||||
|
||||
|
||||
|
||||
[self.stackView addArrangedSubview:self.titleLabel];
|
||||
[self.stackView addArrangedSubview:self.birthdayView];
|
||||
[self.stackView addArrangedSubview:self.wealthView];
|
||||
[self.stackView addArrangedSubview:self.charmView];
|
||||
|
||||
[self.bgView addSubview:self.titleLabel];
|
||||
[self.bgView addSubview:self.tagImageView];
|
||||
[self.bgView addSubview:self.idLabel];
|
||||
[self.bgView addSubview:self.numberLabel];
|
||||
[self.bgView addSubview:self.numberImageView];
|
||||
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(0));
|
||||
make.width.mas_equalTo(kGetScaleWidth(351));
|
||||
make.height.mas_equalTo(kGetScaleWidth(96));
|
||||
make.centerX.equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
[self.borderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(10));
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(68));
|
||||
make.top.mas_equalTo(kGetScaleWidth(14));
|
||||
}];
|
||||
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(74, 74));
|
||||
make.centerY.mas_equalTo(self.bgView);
|
||||
make.left.mas_equalTo(self.contentView).offset(15);
|
||||
}];
|
||||
|
||||
[self.crossPkImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.avatarImageView);
|
||||
}];
|
||||
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.contentView).offset(36);
|
||||
make.right.mas_equalTo(self.contentView).offset(-15);
|
||||
make.top.mas_equalTo(self.contentView);
|
||||
make.bottom.mas_equalTo(self.contentView).offset(-12);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.bgView).offset(65);
|
||||
make.bottom.mas_equalTo(self.bgView.mas_centerY).offset(-8);
|
||||
make.right.equalTo(self.numberImageView.mas_left).offset(-10);
|
||||
}];
|
||||
|
||||
[self.tagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(32, 15));
|
||||
make.left.mas_equalTo(self.titleLabel);
|
||||
make.top.mas_equalTo(self.bgView.mas_centerY).offset(8);
|
||||
}];
|
||||
|
||||
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(65);
|
||||
make.centerY.mas_equalTo(self.tagImageView);
|
||||
}];
|
||||
|
||||
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.bgView).offset(-12);
|
||||
make.width.mas_equalTo(40);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
|
||||
[self.numberImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(18, 18));
|
||||
make.right.mas_equalTo(self.numberLabel.mas_left).offset(-2);
|
||||
make.centerY.mas_equalTo(self.numberLabel);
|
||||
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(60), kGetScaleWidth(60)));
|
||||
make.center.equalTo(self.borderImageView);
|
||||
}];
|
||||
|
||||
[self.greenView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(10));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(60));
|
||||
make.top.mas_equalTo(kGetScaleWidth(64));
|
||||
}];
|
||||
[self.greenView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(48));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(14));
|
||||
make.width.mas_equalTo(kGetScaleWidth(60));
|
||||
make.height.mas_equalTo(kGetScaleWidth(30));
|
||||
}];
|
||||
[self.gameIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(57));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(26));
|
||||
make.width.mas_equalTo(kGetScaleWidth(37));
|
||||
make.height.mas_equalTo(kGetScaleWidth(17));
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(84));
|
||||
make.top.mas_equalTo(kGetScaleWidth(10));
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(10));
|
||||
}];
|
||||
[self.birthdayView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(28));
|
||||
make.height.mas_equalTo(kGetScaleWidth(14));
|
||||
}];
|
||||
[self.wealthView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(36));
|
||||
make.height.mas_equalTo(kGetScaleWidth(18));
|
||||
}];
|
||||
[self.charmView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(36));
|
||||
make.height.mas_equalTo(kGetScaleWidth(18));
|
||||
}];
|
||||
[self.chatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(34));
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(10));
|
||||
make.height.mas_equalTo(kGetScaleWidth(28));
|
||||
make.width.mas_equalTo(kGetScaleWidth(60));
|
||||
}];
|
||||
[self.tagView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(84));
|
||||
make.top.mas_equalTo(kGetScaleWidth(34));
|
||||
make.height.mas_equalTo(kGetScaleWidth(18));
|
||||
make.trailing.equalTo(self.chatBtn.mas_leading).mas_offset(-kGetScaleWidth(5));
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setRoomInfo:(HomePlayRoomModel *)roomInfo {
|
||||
_roomInfo = roomInfo;
|
||||
if (_roomInfo) {
|
||||
self.crossPkImageView.hidden = !_roomInfo.crossPking;
|
||||
self.avatarImageView.imageUrl = _roomInfo.avatar;
|
||||
self.titleLabel.text = _roomInfo.title;
|
||||
if (_roomInfo.tagPict.length > 0){
|
||||
self.tagImageView.imageUrl = _roomInfo.tagPict;
|
||||
self.tagImageView.hidden = NO;
|
||||
[self.idLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(106);
|
||||
}];
|
||||
}else{
|
||||
self.tagImageView.hidden = YES;
|
||||
[self.idLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(65);
|
||||
}];
|
||||
}
|
||||
|
||||
self.idLabel.text = [NSString stringWithFormat:@"ID:%@", _roomInfo.erbanNo];
|
||||
self.numberLabel.text = [NSString stringWithFormat:@"%ld", _roomInfo.onlineNum];
|
||||
CGFloat getWidth = [self.numberLabel.text sizeWithAttributes:@{NSFontAttributeName:self.numberLabel.font}].width+5;
|
||||
[self.numberLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(getWidth);
|
||||
}];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setRoomInfo1:(HomeRecommendRoomModel *)roomInfo1 {
|
||||
_roomInfo1 = roomInfo1;
|
||||
if (_roomInfo1) {
|
||||
self.crossPkImageView.hidden = !_roomInfo1.crossPking;
|
||||
|
||||
self.avatarImageView.imageUrl = _roomInfo1.avatar;
|
||||
self.titleLabel.text = _roomInfo1.title;
|
||||
if (_roomInfo1.tagPict.length > 0){
|
||||
self.tagImageView.imageUrl = _roomInfo1.tagPict;
|
||||
self.tagImageView.hidden = NO;
|
||||
[self.idLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(106);
|
||||
}];
|
||||
}else{
|
||||
self.tagImageView.hidden = YES;
|
||||
[self.idLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(65);
|
||||
}];
|
||||
}
|
||||
self.idLabel.text = [NSString stringWithFormat:@"ID:%@", _roomInfo1.erbanNo];
|
||||
self.numberLabel.text = [NSString stringWithFormat:@"%ld", _roomInfo1.onlineNum];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)crossPkImageView {
|
||||
if (!_crossPkImageView) {
|
||||
_crossPkImageView = [[UIImageView alloc] init];
|
||||
_crossPkImageView.userInteractionEnabled = YES;
|
||||
_crossPkImageView.image = [UIImage imageNamed:@"home_cross_pk"];
|
||||
}
|
||||
return _crossPkImageView;
|
||||
}
|
||||
|
||||
|
||||
- (NetImageView *)avatarImageView {
|
||||
if (!_avatarImageView) {
|
||||
@@ -188,9 +192,9 @@
|
||||
- (UIView *)bgView {
|
||||
if (!_bgView) {
|
||||
_bgView = [[UIView alloc] init];
|
||||
_bgView.backgroundColor = [DJDKMIMOMColor appCellBackgroundColor];
|
||||
_bgView.backgroundColor = [UIColor whiteColor];
|
||||
_bgView.layer.masksToBounds = YES;
|
||||
_bgView.layer.cornerRadius = 14;
|
||||
_bgView.layer.cornerRadius = kGetScaleWidth(12);
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
@@ -204,38 +208,85 @@
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (NetImageView *)tagImageView {
|
||||
if (!_tagImageView) {
|
||||
_tagImageView = [[NetImageView alloc] init];
|
||||
}
|
||||
return _tagImageView;
|
||||
- (UIImageView *)borderImageView {
|
||||
if (!_borderImageView) {
|
||||
_borderImageView = [[UIImageView alloc] init];
|
||||
_borderImageView.userInteractionEnabled = YES;
|
||||
_borderImageView.layer.cornerRadius = kGetScaleWidth(68)/2;
|
||||
_borderImageView.layer.masksToBounds = YES;
|
||||
_borderImageView.layer.borderWidth = kGetScaleWidth(2);
|
||||
_borderImageView.layer.borderColor = UIColorFromRGB(0xA974FF).CGColor;
|
||||
}
|
||||
return _borderImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)idLabel {
|
||||
if (!_idLabel) {
|
||||
_idLabel = [[UILabel alloc] init];
|
||||
_idLabel.font = [UIFont systemFontOfSize:13];
|
||||
_idLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
}
|
||||
return _idLabel;
|
||||
- (UIView *)greenView{
|
||||
if(!_greenView){
|
||||
_greenView = [UIView new];
|
||||
_greenView.backgroundColor = UIColorFromRGB(0x3FE05F);
|
||||
_greenView.layer.cornerRadius = kGetScaleWidth(10)/2;
|
||||
_greenView.layer.masksToBounds = YES;
|
||||
_greenView.layer.borderWidth = 1;
|
||||
_greenView.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
}
|
||||
return _greenView;
|
||||
}
|
||||
|
||||
- (UIImageView *)numberImageView {
|
||||
if (!_numberImageView) {
|
||||
_numberImageView = [[UIImageView alloc] init];
|
||||
_numberImageView.userInteractionEnabled = YES;
|
||||
_numberImageView.image = [UIImage imageNamed:@"home_party_number"];
|
||||
}
|
||||
return _numberImageView;
|
||||
- (UIImageView *)gameBgView{
|
||||
if(!_gameBgView){
|
||||
_gameBgView = [UIImageView new];
|
||||
_gameBgView.image = kImage(@"home_palying_bg");
|
||||
}
|
||||
return _gameBgView;
|
||||
}
|
||||
|
||||
- (UILabel *)numberLabel {
|
||||
if (!_numberLabel) {
|
||||
_numberLabel = [[UILabel alloc] init];
|
||||
_numberLabel.font = [UIFont systemFontOfSize:13];
|
||||
_numberLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
}
|
||||
return _numberLabel;
|
||||
- (UIImageView *)gameIconView{
|
||||
if(!_gameIconView){
|
||||
_gameIconView = [UIImageView new];
|
||||
_gameIconView.image = kImage(@"home_palying_icon");
|
||||
}
|
||||
return _gameIconView;
|
||||
}
|
||||
- (UIButton *)chatBtn{
|
||||
if(!_chatBtn){
|
||||
_chatBtn = [UIButton new];
|
||||
_chatBtn.backgroundColor = UIColorFromRGB(0x9168FA);
|
||||
[_chatBtn setTitle:YMLocalizedString(@"XPSessionSayHelloTableViewCell0") forState:UIControlStateNormal];
|
||||
_chatBtn.titleLabel.font = kFontMedium(12);
|
||||
[_chatBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_chatBtn.layer.cornerRadius = kGetScaleWidth(28)/2;
|
||||
_chatBtn.layer.masksToBounds = YES;
|
||||
}
|
||||
return _chatBtn;
|
||||
}
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = kGetScaleWidth(4);
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
- (UIButton *)birthdayView{
|
||||
if(!_birthdayView){
|
||||
_birthdayView = [UIButton new];
|
||||
[_birthdayView setImage:kImage(@"home_age_boy_icon") forState:UIControlStateNormal];
|
||||
[_birthdayView setImage:kImage(@"home_age_girl_icon") forState:UIControlStateSelected];
|
||||
_birthdayView.titleLabel.font = kFontMedium(10);
|
||||
[_birthdayView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_birthdayView.imageEdgeInsets = UIEdgeInsetsMake(0, kGetScaleWidth(10), 0, 0);
|
||||
}
|
||||
return _birthdayView;
|
||||
}
|
||||
- (NetImageView *)wealthView{
|
||||
if(!_wealthView){
|
||||
_wealthView = [[NetImageView alloc]init];
|
||||
}
|
||||
return _wealthView;
|
||||
}
|
||||
- (NetImageView *)charmView{
|
||||
if(!_charmView){
|
||||
_charmView = [[NetImageView alloc]init];
|
||||
}
|
||||
return _charmView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
18
YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyTagView.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// XPNewHomePartyTagView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/4.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPNewHomePartyTagView : UIView
|
||||
@property (nonatomic,strong) NSMutableArray *itemList;
|
||||
@end
|
||||
@interface XPNewHomePartyTagItemView : UICollectionViewCell
|
||||
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
105
YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyTagView.m
Normal file
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// XPNewHomePartyTagView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/4.
|
||||
//
|
||||
|
||||
#import "XPNewHomePartyTagView.h"
|
||||
#import "XPMineUserInfoTagFlowLayout.h"
|
||||
@interface XPNewHomePartyTagView()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout,EqualSpaceFlowLayoutDelegate>
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
@end
|
||||
@implementation XPNewHomePartyTagView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.collectionView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
}
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return CGSizeMake(100, 18);
|
||||
}
|
||||
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
|
||||
return self.itemList.count;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
XPNewHomePartyTagItemView *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPNewHomePartyTagItemView class]) forIndexPath:indexPath];
|
||||
return cell;
|
||||
}
|
||||
-(void)setItemList:(NSMutableArray *)itemList{
|
||||
_itemList = itemList;
|
||||
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
XPMineUserInfoTagFlowLayout *layout = [[XPMineUserInfoTagFlowLayout alloc] init];
|
||||
layout.delegate = self;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
|
||||
layout.minimumLineSpacing = 0;
|
||||
layout.minimumInteritemSpacing = 5;
|
||||
layout.estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize;// 自适应
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.pagingEnabled = NO;
|
||||
_collectionView.scrollEnabled = NO;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[XPNewHomePartyTagItemView class] forCellWithReuseIdentifier:NSStringFromClass([XPNewHomePartyTagItemView class])];
|
||||
_collectionView.showsVerticalScrollIndicator = NO;
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@interface XPNewHomePartyTagItemView ()
|
||||
@property(nonatomic,strong) UILabel *titleView;
|
||||
@end
|
||||
|
||||
@implementation XPNewHomePartyTagItemView
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
self.contentView.layer.cornerRadius = kGetScaleWidth(16)/2;
|
||||
self.contentView.layer.masksToBounds = YES;
|
||||
[self.contentView addSubview:self.titleView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.equalTo(self.contentView);
|
||||
make.leading.trailing.equalTo(self.contentView).inset(kGetScaleWidth(16));
|
||||
}];
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UILabel *)titleView{
|
||||
if(!_titleView){
|
||||
_titleView = [UILabel labelInitWithText:@"" font:kFontRegular(10) textColor:UIColorFromRGB(0x8A8CAB)];
|
||||
_titleView.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
|
||||
@end
|
@@ -8,18 +8,14 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "ClanDetailInfoModel.h"
|
||||
|
||||
@protocol XPNewHomePlayEmptyTableViewCellDelegate <NSObject>
|
||||
|
||||
-(void)emptyCellChooseGameAction;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPNewHomePlayEmptyTableViewCell : UITableViewCell
|
||||
@property (nonatomic,assign) BOOL isClan;
|
||||
@property (nonatomic,weak) id<XPNewHomePlayEmptyTableViewCellDelegate> delegate;
|
||||
-(void)setConstraints;
|
||||
-(void)setTitle:(NSString *)title;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -14,13 +14,8 @@
|
||||
|
||||
@interface XPNewHomePlayEmptyTableViewCell ()
|
||||
|
||||
///背景
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///添加
|
||||
@property (nonatomic,strong) UIImageView *addImageView;
|
||||
///显示标题
|
||||
@property (nonatomic,strong) UIImageView *emptyImageView;
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
@property (nonatomic,strong) UIButton *chooseGameBtn;
|
||||
@end
|
||||
|
||||
@implementation XPNewHomePlayEmptyTableViewCell
|
||||
@@ -33,98 +28,54 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)setTitle:(NSString *)title{
|
||||
_titleLabel.text = title;
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self.contentView addSubview:self.backImageView];
|
||||
[self.backImageView addSubview:self.addImageView];
|
||||
[self.backImageView addSubview:self.titleLabel];
|
||||
[self.contentView addSubview:self.chooseGameBtn];
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.contentView.backgroundColor =[UIColor clearColor];
|
||||
[self.contentView addSubview:self.emptyImageView];
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.left.mas_equalTo(self.contentView).inset(15);
|
||||
make.top.bottom.mas_equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
[self.addImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(48, 48));
|
||||
make.left.mas_equalTo(self.backImageView).offset(12);
|
||||
make.centerY.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.addImageView.mas_right).offset(15);
|
||||
make.right.equalTo(self.backImageView.mas_right).mas_offset(-12);
|
||||
make.centerY.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
[self.chooseGameBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-11);
|
||||
make.width.mas_equalTo(120);
|
||||
make.top.bottom.equalTo(self.contentView);
|
||||
-(void)setConstraints{
|
||||
[self.emptyImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.contentView).offset(kGetScaleWidth(90));
|
||||
}];
|
||||
}
|
||||
-(void)chooseGameAction{
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(emptyCellChooseGameAction)]){
|
||||
[self.delegate emptyCellChooseGameAction];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setIsClan:(BOOL)isClan{
|
||||
_isClan = isClan;
|
||||
if(_isClan == NO){
|
||||
_chooseGameBtn.hidden = NO;
|
||||
[self.backImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-141);
|
||||
}];
|
||||
return;
|
||||
}
|
||||
_chooseGameBtn.hidden = YES;
|
||||
[self.backImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-15);
|
||||
- (void)initSubViewConstraints {
|
||||
[self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.contentView).offset(150);
|
||||
make.size.mas_equalTo(CGSizeMake(100, 100));
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.emptyImageView.mas_bottom).offset(20);
|
||||
make.left.right.mas_equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
|
||||
- (UIImageView *)addImageView {
|
||||
if (!_addImageView) {
|
||||
_addImageView = [[UIImageView alloc] init];
|
||||
_addImageView.userInteractionEnabled = YES;
|
||||
_addImageView.image = [UIImage imageNamed:@"home_play_create_room"];
|
||||
}
|
||||
return _addImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor colorWithHexString:@"#E7D7FC"], [DJDKMIMOMColor colorWithHexString:@"#D7F8FD"]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
|
||||
_backImageView.layer.masksToBounds = YES;
|
||||
_backImageView.layer.cornerRadius = 10;
|
||||
_backImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _backImageView;
|
||||
- (UIImageView *)emptyImageView {
|
||||
if (!_emptyImageView) {
|
||||
_emptyImageView = [[UIImageView alloc] init];
|
||||
_emptyImageView.userInteractionEnabled = YES;
|
||||
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
|
||||
_emptyImageView.layer.masksToBounds = YES;
|
||||
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _emptyImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_titleLabel.numberOfLines = 0;
|
||||
_titleLabel.text = YMLocalizedString(@"XPNewHomePlayEmptyTableViewCell0");
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
- (UIButton *)chooseGameBtn{
|
||||
if (!_chooseGameBtn){
|
||||
_chooseGameBtn = [UIButton new];
|
||||
[_chooseGameBtn setBackgroundImage:[UIImage imageNamed:@"home_play_game"] forState:UIControlStateNormal];
|
||||
[_chooseGameBtn addTarget:self action:@selector(chooseGameAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
_chooseGameBtn.hidden = YES;
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = YMLocalizedString(@"XPGuildEmptyCollectionViewCell0");
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_titleLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
}
|
||||
return _chooseGameBtn;
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -12,12 +12,21 @@
|
||||
#import "NetImageView.h"
|
||||
///Model
|
||||
#import "HomePlayRoomModel.h"
|
||||
|
||||
#import <SDWebImageFLPlugin/SDWebImageFLPlugin.h>
|
||||
@interface XPNewHomePlayItemCollectionViewCell ()
|
||||
@property(nonatomic,strong) UIView *bgView;
|
||||
///边框
|
||||
@property (nonatomic,strong) UIImageView *borderImageView;
|
||||
///头像
|
||||
@property (nonatomic,strong) NetImageView *avatarImageView;
|
||||
///游戏背景
|
||||
@property(nonatomic,strong) UIImageView *gameBgView;
|
||||
///游戏图标
|
||||
@property(nonatomic,strong) UIImageView *gameIconView;
|
||||
///在线
|
||||
@property(nonatomic,strong) FLAnimatedImageView *onlineGifView;
|
||||
///用户名
|
||||
@property(nonatomic,strong) UILabel *nameView;
|
||||
@end
|
||||
|
||||
@implementation XPNewHomePlayItemCollectionViewCell
|
||||
@@ -34,19 +43,55 @@
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.contentView.backgroundColor = [UIColor clearColor];
|
||||
[self.contentView addSubview:self.borderImageView];
|
||||
[self.contentView addSubview:self.avatarImageView];
|
||||
[self.contentView addSubview:self.bgView];
|
||||
[self.bgView addSubview:self.borderImageView];
|
||||
[self.bgView addSubview:self.avatarImageView];
|
||||
|
||||
[self.bgView addSubview:self.gameBgView];
|
||||
[self.bgView addSubview:self.gameIconView];
|
||||
[self.bgView addSubview:self.onlineGifView];
|
||||
[self.bgView addSubview:self.nameView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.contentView);
|
||||
}];
|
||||
[self.borderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.contentView);
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(60));
|
||||
make.top.mas_equalTo(kGetScaleWidth(6));
|
||||
make.centerX.equalTo(self.bgView);
|
||||
}];
|
||||
|
||||
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(52, 52));
|
||||
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(52), kGetScaleWidth(52)));
|
||||
make.center.mas_equalTo(self.borderImageView);
|
||||
}];
|
||||
[self.gameBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(39));
|
||||
make.width.mas_equalTo(kGetScaleWidth(52));
|
||||
make.height.mas_equalTo(kGetScaleWidth(23));
|
||||
make.centerX.equalTo(self.bgView);
|
||||
}];
|
||||
[self.gameIconView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(43));
|
||||
make.width.mas_equalTo(kGetScaleWidth(28));
|
||||
make.height.mas_equalTo(kGetScaleWidth(17));
|
||||
make.centerX.equalTo(self.bgView);
|
||||
}];
|
||||
|
||||
[self.nameView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_lessThanOrEqualTo(kGetScaleWidth(79));
|
||||
make.centerX.equalTo(self.bgView).mas_offset(kGetScaleWidth(10));
|
||||
make.height.mas_equalTo(kGetScaleWidth(17));
|
||||
make.top.equalTo(self.borderImageView.mas_bottom).mas_offset(kGetScaleWidth(3));
|
||||
}];
|
||||
[self.onlineGifView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(9));
|
||||
make.height.mas_equalTo(kGetScaleWidth(8));
|
||||
make.centerY.equalTo(self.nameView);
|
||||
make.trailing.equalTo(self.nameView.mas_leading).mas_offset(-kGetScaleWidth(2));
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -54,14 +99,25 @@
|
||||
_roomInfo = roomInfo;
|
||||
if (_roomInfo != nil) {
|
||||
self.avatarImageView.imageUrl = _roomInfo.avatar;
|
||||
self.borderImageView.image = _roomInfo.gender == GenderType_Male ? [UIImage imageNamed:@"home_play_male_border"] : [UIImage imageNamed:@"home_play_female_border"];
|
||||
self.nameView.text = _roomInfo.title;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIView *)bgView{
|
||||
if(!_bgView){
|
||||
_bgView = [UIView new];
|
||||
_bgView.backgroundColor = [UIColor whiteColor];
|
||||
[_bgView setCornerWithLeftTopCorner:kGetScaleWidth(10) rightTopCorner:kGetScaleWidth(10) bottomLeftCorner:kGetScaleWidth(10) bottomRightCorner:kGetScaleWidth(10) size:CGSizeMake(kGetScaleWidth(100), kGetScaleWidth(92))];
|
||||
}
|
||||
return _bgView;
|
||||
}
|
||||
- (UIImageView *)borderImageView {
|
||||
if (!_borderImageView) {
|
||||
_borderImageView = [[UIImageView alloc] init];
|
||||
_borderImageView.userInteractionEnabled = YES;
|
||||
_borderImageView.layer.cornerRadius = kGetScaleWidth(60)/2;
|
||||
_borderImageView.layer.masksToBounds = YES;
|
||||
_borderImageView.layer.borderWidth = kGetScaleWidth(2);
|
||||
_borderImageView.layer.borderColor = UIColorFromRGB(0x759FFF).CGColor;
|
||||
}
|
||||
return _borderImageView;
|
||||
}
|
||||
@@ -73,11 +129,38 @@
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatarImageView.layer.masksToBounds = YES;
|
||||
_avatarImageView.layer.cornerRadius = 52/2;
|
||||
_avatarImageView.layer.borderColor = [UIColor whiteColor].CGColor;
|
||||
_avatarImageView.layer.borderWidth = 1;
|
||||
_avatarImageView.layer.cornerRadius = kGetScaleWidth(52)/2;
|
||||
}
|
||||
return _avatarImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)gameBgView{
|
||||
if(!_gameBgView){
|
||||
_gameBgView = [UIImageView new];
|
||||
_gameBgView.image = kImage(@"_home_game_bg");
|
||||
}
|
||||
return _gameBgView;
|
||||
}
|
||||
- (UIImageView *)gameIconView{
|
||||
if(!_gameIconView){
|
||||
_gameIconView = [UIImageView new];
|
||||
_gameIconView.image = kImage(@"_home_game_icon");
|
||||
}
|
||||
return _gameIconView;
|
||||
}
|
||||
- (FLAnimatedImageView *)onlineGifView{
|
||||
if(!_onlineGifView){
|
||||
_onlineGifView = [FLAnimatedImageView new];
|
||||
NSData *localData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"home_sound_wave.gif" ofType:nil]];
|
||||
FLAnimatedImage *animatedImage = [FLAnimatedImage animatedImageWithGIFData:localData];
|
||||
_onlineGifView.animatedImage = animatedImage;
|
||||
|
||||
}
|
||||
return _onlineGifView;
|
||||
}
|
||||
- (UILabel *)nameView{
|
||||
if(!_nameView){
|
||||
_nameView = [UILabel labelInitWithText:@"" font:kFontMedium(12) textColor:UIColorFromRGB(0x1F1B4F)];
|
||||
}
|
||||
return _nameView;
|
||||
}
|
||||
@end
|
||||
|
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (nonatomic,strong) NSArray *playRoomList;
|
||||
|
||||
@property (nonatomic,assign) BOOL isClan;
|
||||
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPNewHomePlayTableViewCellDelegate> delegate;
|
||||
@end
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
@interface XPNewHomePlayTableViewCell ()<UICollectionViewDelegate, UICollectionViewDataSource>
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
@property (nonatomic,strong) UIButton *chooseGameBtn;
|
||||
|
||||
|
||||
@end
|
||||
@implementation XPNewHomePlayTableViewCell
|
||||
@@ -29,21 +29,7 @@
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)setIsClan:(BOOL)isClan{
|
||||
_isClan = isClan;
|
||||
if(_isClan == NO){
|
||||
_chooseGameBtn.hidden = NO;
|
||||
[_collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-141);
|
||||
}];
|
||||
return;
|
||||
}
|
||||
_chooseGameBtn.hidden = YES;
|
||||
[_collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(void)chooseGameAction{
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(chooseGameAction)]){
|
||||
@@ -55,19 +41,14 @@
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self.contentView addSubview:self.collectionView];
|
||||
[self.contentView addSubview:self.chooseGameBtn];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.bottom.mas_equalTo(self.contentView);
|
||||
make.right.mas_equalTo(-136);
|
||||
make.leading.top.trailing.equalTo(self.contentView);
|
||||
make.height.mas_equalTo(kGetScaleWidth(92));
|
||||
}];
|
||||
[self.chooseGameBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-11);
|
||||
make.width.mas_equalTo(120);
|
||||
make.top.bottom.equalTo(self.collectionView);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)setPlayRoomList:(NSArray *)playRoomList{
|
||||
@@ -102,26 +83,19 @@
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.itemSize = CGSizeMake(63, 63);
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15);
|
||||
layout.minimumLineSpacing = 15;
|
||||
layout.itemSize = CGSizeMake(kGetScaleWidth(100), kGetScaleWidth(92));
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, kGetScaleWidth(12), 0, kGetScaleWidth(12));
|
||||
layout.minimumLineSpacing = kGetScaleWidth(8);
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.tag = 9000002;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[XPNewHomePlayItemCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPNewHomePlayItemCollectionViewCell class])];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
- (UIButton *)chooseGameBtn{
|
||||
if (!_chooseGameBtn){
|
||||
_chooseGameBtn = [UIButton new];
|
||||
[_chooseGameBtn setBackgroundImage:[UIImage imageNamed:@"home_play_game"] forState:UIControlStateNormal];
|
||||
[_chooseGameBtn addTarget:self action:@selector(chooseGameAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
_chooseGameBtn.hidden = YES;
|
||||
}
|
||||
return _chooseGameBtn;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -8,9 +8,18 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "HomeBannerInfoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class PIHomeItemModel;
|
||||
@protocol XPNewHomeHeadViewDelegate <NSObject>
|
||||
///选择
|
||||
-(void)selectItemWithModel:(PIHomeItemModel *)model;
|
||||
-(void)selectBannerListWithModel:(HomeBannerInfoModel *)model;
|
||||
@end
|
||||
|
||||
|
||||
@interface XPNewHomeHeadView : UIView
|
||||
@property (nonatomic,strong) NSArray<HomeBannerInfoModel *> *bannerList;
|
||||
@property (nonatomic,copy) NSArray<HomeBannerInfoModel *> *bannerList;
|
||||
@property(nonatomic,copy) NSArray *itemList;
|
||||
@property(nonatomic,weak) id<XPNewHomeHeadViewDelegate>delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -6,13 +6,10 @@
|
||||
//
|
||||
|
||||
#import "XPNewHomeHeadView.h"
|
||||
#import "XPNewHomeItemView.h"
|
||||
#import <SDCycleScrollView/SDCycleScrollView.h>
|
||||
@interface XPNewHomeHeadView ()<SDCycleScrollViewDelegate>
|
||||
///心动恋爱
|
||||
@property(nonatomic,strong) XPNewHomeItemView *loveView;
|
||||
///陪伴交友
|
||||
@property(nonatomic,strong) XPNewHomeItemView *friendView;
|
||||
#import "XPNewHomeItemCell.h"
|
||||
@interface XPNewHomeHeadView ()<SDCycleScrollViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||
@property(nonatomic,strong) UICollectionView *collectionView;
|
||||
///轮播图
|
||||
@property (nonatomic, strong) SDCycleScrollView *pi_BannerView;
|
||||
@end
|
||||
@@ -27,25 +24,19 @@
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.loveView];
|
||||
[self addSubview:self.friendView];
|
||||
[self addSubview:self.collectionView];
|
||||
[self addSubview:self.pi_BannerView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.loveView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(14));
|
||||
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(0);
|
||||
make.trailing.mas_equalTo(0);
|
||||
make.top.mas_equalTo(kGetScaleWidth(0));
|
||||
make.height.mas_equalTo(kGetScaleWidth(89));
|
||||
make.width.mas_equalTo(kGetScaleWidth(174));
|
||||
}];
|
||||
[self.friendView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(3));
|
||||
make.leading.equalTo(self.loveView.mas_trailing).mas_offset(kGetScaleWidth(3));
|
||||
make.height.mas_equalTo(kGetScaleWidth(84));
|
||||
make.width.mas_equalTo(kGetScaleWidth(171));
|
||||
make.height.mas_equalTo(kGetScaleWidth(80));
|
||||
}];
|
||||
[self.pi_BannerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.loveView.mas_bottom).mas_offset(kGetScaleWidth(5));
|
||||
make.top.equalTo(self.collectionView.mas_bottom).mas_offset(kGetScaleWidth(10));
|
||||
make.leading.trailing.equalTo(self).inset(kGetScaleWidth(14));
|
||||
make.height.mas_equalTo(kGetScaleWidth(80));
|
||||
}];
|
||||
@@ -54,9 +45,10 @@
|
||||
#pragma mark - SDCycleScrollViewDelegate
|
||||
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
|
||||
HomeBannerInfoModel * bannerInfo = [self.bannerList safeObjectAtIndex1:index];
|
||||
// if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeBannerTableViewCell:didClickBanner:)]) {
|
||||
// [self.delegate xPHomeBannerTableViewCell:self didClickBanner:bannerInfo];
|
||||
// }
|
||||
if(bannerInfo != nil && self.delegate && [self.delegate respondsToSelector:@selector(selectBannerListWithModel:)]){
|
||||
[self.delegate selectBannerListWithModel:bannerInfo];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -78,25 +70,54 @@
|
||||
_pi_BannerView.hidden = YES;
|
||||
}
|
||||
}
|
||||
- (void)setItemList:(NSArray *)itemList{
|
||||
_itemList = itemList;
|
||||
self.collectionView.scrollEnabled = _itemList.count > 2;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
|
||||
return self.itemList.count > 0 ? self.itemList.count : 2;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
XPNewHomeItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPNewHomeItemCell class]) forIndexPath:indexPath];
|
||||
if(indexPath.row < self.itemList.count){
|
||||
cell.itmeModel = self.itemList[indexPath.row];
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
PIHomeItemModel *model = [self.itemList safeObjectAtIndex1:indexPath.row];
|
||||
if(model != nil && self.delegate && [self.delegate respondsToSelector:@selector(selectItemWithModel:)]){
|
||||
[self.delegate selectItemWithModel:model];
|
||||
}
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (XPNewHomeItemView *)loveView{
|
||||
if(!_loveView){
|
||||
_loveView = [[XPNewHomeItemView alloc]initWithFrame:CGRectZero type:0];
|
||||
_loveView.title = YMLocalizedString(@"XPNewHomeHeadView0");
|
||||
_loveView.subTitle = YMLocalizedString(@"XPNewHomeHeadView1");
|
||||
_loveView.bgImage = kImage(@"home_head_love_bg");
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, kGetScaleWidth(15), 0, kGetScaleWidth(15));
|
||||
layout.minimumLineSpacing = 0;
|
||||
layout.minimumInteritemSpacing = kGetScaleWidth(8);
|
||||
layout.itemSize = CGSizeMake(kGetScaleWidth(168), kGetScaleWidth(80));
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.pagingEnabled = NO;
|
||||
_collectionView.scrollEnabled = NO;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[XPNewHomeItemCell class] forCellWithReuseIdentifier:NSStringFromClass([XPNewHomeItemCell class])];
|
||||
_collectionView.showsVerticalScrollIndicator = NO;
|
||||
}
|
||||
return _loveView;
|
||||
}
|
||||
- (XPNewHomeItemView *)friendView{
|
||||
if(!_friendView){
|
||||
_friendView = [[XPNewHomeItemView alloc]initWithFrame:CGRectZero type:1];
|
||||
_friendView.title = YMLocalizedString(@"XPNewHomeHeadView2");
|
||||
_friendView.subTitle = YMLocalizedString(@"XPNewHomeHeadView3");
|
||||
_friendView.bgImage = kImage(@"home_head_friend_bg");
|
||||
}
|
||||
return _friendView;
|
||||
return _collectionView;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
|
||||
- (SDCycleScrollView *)pi_BannerView {
|
||||
if (!_pi_BannerView) {
|
||||
_pi_BannerView = [[SDCycleScrollView alloc] init];
|
||||
@@ -104,8 +125,11 @@
|
||||
_pi_BannerView.layer.cornerRadius = 10;
|
||||
_pi_BannerView.layer.masksToBounds = YES;
|
||||
_pi_BannerView.delegate = self;
|
||||
_pi_BannerView.showPageControl = NO;
|
||||
_pi_BannerView.showPageControl = YES;
|
||||
_pi_BannerView.autoScrollTimeInterval = 5.0;
|
||||
_pi_BannerView.currentPageDotColor = UIColorFromRGB(0x9168FA);
|
||||
_pi_BannerView.pageDotColor = UIColorRGBAlpha(0xB3B3C3, 0.4);
|
||||
_pi_BannerView.pageControlDotSize = CGSizeMake(kGetScaleWidth(4), kGetScaleWidth(4));
|
||||
_pi_BannerView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
|
||||
_pi_BannerView.placeholderImage = [UIImageConstant defalutBannerPlaceholder];
|
||||
_pi_BannerView.tag = 9000001;
|
||||
|
16
YuMi/Modules/YMNewHome/View/CustomView/XPNewHomeItemCell.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPNewHomeItemCell.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "PIHomeItemModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPNewHomeItemCell : UICollectionViewCell
|
||||
@property(nonatomic,strong) PIHomeItemModel *itmeModel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
43
YuMi/Modules/YMNewHome/View/CustomView/XPNewHomeItemCell.m
Normal file
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// XPNewHomeItemCell.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/5.
|
||||
//
|
||||
|
||||
#import "XPNewHomeItemCell.h"
|
||||
@interface XPNewHomeItemCell ()
|
||||
///背景
|
||||
@property(nonatomic,strong) NetImageView *bgImageView;
|
||||
@end
|
||||
@implementation XPNewHomeItemCell
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self.contentView addSubview:self.bgImageView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
-(void)setItmeModel:(PIHomeItemModel *)itmeModel{
|
||||
_itmeModel = itmeModel;
|
||||
_bgImageView.imageUrl = _itmeModel.icon;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (NetImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
NetImageConfig *config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = [UIImageConstant defalutBannerPlaceholder];
|
||||
_bgImageView = [[NetImageView alloc]initWithConfig:config];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
@end
|
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// XPNewHomeItemView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/1.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPNewHomeItemView : UIView
|
||||
@property(nonatomic,strong) UIImage *bgImage;
|
||||
@property(nonatomic,copy) NSString *title;
|
||||
@property(nonatomic,strong) NSString *subTitle;
|
||||
-(instancetype)initWithFrame:(CGRect)frame type:(int)type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,96 +0,0 @@
|
||||
//
|
||||
// XPNewHomeItemView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/1.
|
||||
//
|
||||
|
||||
#import "XPNewHomeItemView.h"
|
||||
@interface XPNewHomeItemView()
|
||||
///背景
|
||||
@property(nonatomic,strong) UIImageView *bgImageView;
|
||||
//标题
|
||||
@property(nonatomic,strong) UILabel *titleView;
|
||||
///副标题
|
||||
@property(nonatomic,strong) UILabel *subTitleView;
|
||||
@property(nonatomic,assign) int type;
|
||||
@end
|
||||
|
||||
@implementation XPNewHomeItemView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame type:(int)type{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.bgImageView];
|
||||
[self.bgImageView addSubview:self.titleView];
|
||||
[self.bgImageView addSubview:self.subTitleView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
if(self.type == 0){
|
||||
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(25));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(11));
|
||||
make.height.mas_equalTo(kGetScaleWidth(18));
|
||||
}];
|
||||
[self.subTitleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(49));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(11));
|
||||
make.height.mas_equalTo(kGetScaleWidth(17));
|
||||
}];
|
||||
return;
|
||||
}
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(22));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(11));
|
||||
make.height.mas_equalTo(kGetScaleWidth(18));
|
||||
}];
|
||||
[self.subTitleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(46));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(11));
|
||||
make.height.mas_equalTo(kGetScaleWidth(17));
|
||||
}];
|
||||
}
|
||||
#pragma mark - 赋值
|
||||
- (void)setBgImage:(UIImage *)bgImage{
|
||||
_bgImage = bgImage;
|
||||
_bgImageView.image = bgImage;
|
||||
}
|
||||
- (void)setTitle:(NSString *)title{
|
||||
_title = title;
|
||||
_titleView.text = _title;
|
||||
}
|
||||
- (void)setSubTitle:(NSString *)subTitle{
|
||||
_subTitle = subTitle;
|
||||
_subTitleView.text = _subTitle;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UIImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
_bgImageView = [UIImageView new];
|
||||
_bgImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
- (UILabel *)titleView{
|
||||
if(!_titleView){
|
||||
_titleView = [UILabel labelInitWithText:@"" font:kFontBold(18) textColor:[UIColor whiteColor]];
|
||||
}
|
||||
return _titleView;
|
||||
}
|
||||
- (UILabel *)subTitleView{
|
||||
if(!_subTitleView){
|
||||
_subTitleView = [UILabel labelInitWithText:@"" font:kFontRegular(12) textColor:[UIColor colorWithWhite:1 alpha:0.8]];
|
||||
}
|
||||
return _subTitleView;
|
||||
}
|
||||
@end
|
@@ -56,8 +56,8 @@
|
||||
self.fristBnt.selected = sender == self.fristBnt;
|
||||
self.secondBnt.selected = sender != self.fristBnt;
|
||||
if(self.fristBnt == sender){
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(didClickSelectedItemAtIndex:)]){
|
||||
[self.delegate categoryView:self didClickSelectedItemAtIndex:0];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(categoryView:didSelectedItemAtIndex:)]){
|
||||
[self.delegate categoryView:self didSelectedItemAtIndex:0];
|
||||
}
|
||||
[self.lineImage mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(36));
|
||||
@@ -67,8 +67,8 @@
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(didClickSelectedItemAtIndex:)]){
|
||||
[self.delegate categoryView:self didClickSelectedItemAtIndex:1];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(categoryView:didSelectedItemAtIndex:)]){
|
||||
[self.delegate categoryView:self didSelectedItemAtIndex:1];
|
||||
}
|
||||
[self.lineImage mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(36));
|
||||
|
@@ -16,23 +16,25 @@
|
||||
///Model
|
||||
#import "HomeRecommendRoomModel.h"
|
||||
///View
|
||||
#import "XPNewHomePartyTableViewCell.h"
|
||||
#import "XPRoomPKEmptyTableViewCell.h"
|
||||
#import "XPNewHomePartyCollectionViewCell.h"
|
||||
#import "XPGuildEmptyCollectionViewCell.h"
|
||||
#import "XPWeakTimer.h"
|
||||
///P
|
||||
#import "XPHomePresenter.h"
|
||||
#import "XPHomeProtocol.h"
|
||||
///VC
|
||||
#import "XPRoomViewController.h"
|
||||
|
||||
@interface XPHomePartyViewController ()<UITableViewDelegate, UITableViewDataSource, XPHomeProtocol>
|
||||
@interface XPHomePartyViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, XPHomeProtocol>
|
||||
///数据源
|
||||
@property (nonatomic,strong) NSMutableArray *datasource;
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
///当前的页数
|
||||
@property (nonatomic,assign) int page;
|
||||
///没有新的数据了
|
||||
@property (nonatomic,assign) BOOL hasNoMoreData;
|
||||
@property(nonatomic,strong) NSTimer *timer;
|
||||
@end
|
||||
|
||||
@implementation XPHomePartyViewController
|
||||
@@ -44,143 +46,111 @@
|
||||
- (XPHomePresenter *)createPresenter {
|
||||
return [[XPHomePresenter alloc] init];
|
||||
}
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
if (self.timer) {
|
||||
[self.timer setFireDate:[NSDate distantPast]]; //很远的过去
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[super viewWillDisappear:animated];
|
||||
if (self.timer) {
|
||||
//关闭定时器
|
||||
[self.timer setFireDate:[NSDate distantFuture]]; //很远的将来
|
||||
}
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self initHeaderAndFooterRrfresh];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.view addSubview:self.collectionView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
- (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 = [DJDKMIMOMColor secondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
self.tableView.mj_header = header;
|
||||
|
||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
|
||||
footer.stateLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
self.tableView.mj_footer = footer;
|
||||
|
||||
self.timer = [XPWeakTimer scheduledTimerWithTimeInterval:15 block:^(id userInfo) {
|
||||
[self headerRefresh];
|
||||
} userInfo:nil repeats:YES];
|
||||
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 = [DJDKMIMOMColor secondTextColor];
|
||||
header.lastUpdatedTimeLabel.textColor = [DJDKMIMOMColor secondTextColor];
|
||||
self.collectionView.mj_header = header;
|
||||
[self.collectionView.mj_header beginRefreshing];
|
||||
}
|
||||
|
||||
#pragma mark - 刷新的fangfa
|
||||
- (void)headerRefresh {
|
||||
self.page = 1;
|
||||
if (self.isAnchor) {
|
||||
[self.presenter getHomeMoreAnchorRoomList];
|
||||
} else {
|
||||
[self.presenter getRecommendRoomList:self.pi_tabId page:self.page pageSize:20 state:0];
|
||||
}
|
||||
|
||||
[self.presenter getHomePersonalRoomList];
|
||||
|
||||
}
|
||||
|
||||
- (void)footerRefresh {
|
||||
if (self.hasNoMoreData) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPHomePartyViewController0")];
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
return;
|
||||
}
|
||||
self.page++;
|
||||
if (self.isAnchor) {
|
||||
[self.presenter getHomeMoreAnchorRoomList];
|
||||
} else {
|
||||
[self.presenter getRecommendRoomList:self.pi_tabId page:self.page pageSize:20 state:1];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UICollectionViewDelegate And UICollectionViewDataSource
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if(self.datasource.count == 0){
|
||||
XPGuildEmptyCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPGuildEmptyCollectionViewCell class]) forIndexPath:indexPath];
|
||||
[cell setConstraints];
|
||||
[cell setTitle:YMLocalizedString(@"XPGuildEmptyCollectionViewCell0")];
|
||||
return cell;
|
||||
}
|
||||
XPNewHomePartyCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPNewHomePartyCollectionViewCell class]) forIndexPath:indexPath];
|
||||
cell.roomInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDelegate And UITableViewDataSource
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (self.datasource.count > 0) {
|
||||
XPNewHomePartyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPNewHomePartyTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPNewHomePartyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomePartyTableViewCell class])];
|
||||
}
|
||||
cell.roomInfo1 = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
XPRoomPKEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPRoomPKEmptyTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPRoomPKEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPRoomPKEmptyTableViewCell class])];
|
||||
}
|
||||
return cell;
|
||||
|
||||
- (NSInteger)collectionView:(nonnull UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
if(self.datasource.count == 0)return 1;
|
||||
return self.datasource.count;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return 96;
|
||||
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if(self.datasource.count == 0)return self.collectionView.frame.size;
|
||||
return CGSizeMake(kGetScaleWidth(174), kGetScaleWidth(178));
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.datasource.count > 0 ? self.datasource.count : 1;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasource.count > 0) {
|
||||
HomeRecommendRoomModel * roomInfo1 = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
if (roomInfo1.roomUid.length > 0) {
|
||||
[XPRoomViewController openRoom:roomInfo1.roomUid viewController:self];
|
||||
}
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
|
||||
|
||||
HomePlayRoomModel * roomInfo = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
if (roomInfo.uid.length > 0) {
|
||||
[XPRoomViewController openRoom:roomInfo.uid viewController:self];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - XPHomeProtocol
|
||||
- (void)getHomeRecommendRoomListSuccess:(NSArray *)list state:(BOOL)state {
|
||||
if (state == 0) {
|
||||
self.hasNoMoreData = NO;
|
||||
[self.datasource removeAllObjects];
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
} else {
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
if (list.count > 0) {
|
||||
self.hasNoMoreData = NO;
|
||||
[self.datasource addObjectsFromArray:list];
|
||||
} else {
|
||||
self.hasNoMoreData = YES;
|
||||
}
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
- (void)getHomeRecommendRoomListFail:(NSString *)message state:(BOOL)state {
|
||||
if (state ==0) {
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
} else {
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
- (void)getHomePersonalRoomListSuccess:(NSArray *)list{
|
||||
for (HomePlayRoomModel *model in list) {
|
||||
model.width = [UILabel getWidthWithText:@(model.onlineNum).stringValue height:kGetScaleWidth(12) font:kFontBold(10)]+1;
|
||||
}
|
||||
self.datasource = [NSMutableArray arrayWithArray:list];
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
- (void)getHomeMoreAnchorRoomListFail:(NSString *)messag {
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
|
||||
- (void)getHomeMoreAnchorRoomListSuccess:(NSArray *)list {
|
||||
[self.tableView.mj_header endRefreshing];
|
||||
[self.tableView.mj_footer endRefreshing];
|
||||
[self.datasource removeAllObjects];
|
||||
[self.datasource addObjectsFromArray:list];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - JXPagingViewListViewDelegate
|
||||
- (UIScrollView *)listScrollView {
|
||||
return self.tableView;
|
||||
return self.collectionView;
|
||||
}
|
||||
|
||||
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
|
||||
@@ -215,26 +185,22 @@
|
||||
}
|
||||
|
||||
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
|
||||
UIView *headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 18)];
|
||||
_tableView.tableHeaderView = headView;
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
if (@available(iOS 11.0, *)) {
|
||||
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
[_tableView registerClass:[XPRoomPKEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPRoomPKEmptyTableViewCell class])];
|
||||
[_tableView registerClass:[XPNewHomePartyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPNewHomePartyTableViewCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumInteritemSpacing = kGetScaleWidth(6);
|
||||
layout.minimumLineSpacing = kGetScaleWidth(6);
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, kGetScaleWidth(10), 0, kGetScaleWidth(10));
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
[_collectionView registerClass:[XPNewHomePartyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPNewHomePartyCollectionViewCell class])];
|
||||
[_collectionView registerClass:[XPGuildEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPGuildEmptyCollectionViewCell class])];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)datasource {
|
||||
if (!_datasource) {
|
||||
|
@@ -40,16 +40,14 @@
|
||||
#import "XPNewHomeRecommendPresenter.h"
|
||||
#import "XPNewHomeRecommendProtocol.h"
|
||||
UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
@interface XPHomeRecommendViewController ()<UITableViewDelegate, UITableViewDataSource, XPNewHomePlayTableViewCellDelegate, XPHomeBannerTableViewCellDelegate, XPNewHomePlayEmptyTableViewCellDelegate,XPNewHomeRecommendTableViewCellDelegate,XPNewHomeRecommendProtocol>
|
||||
@interface XPHomeRecommendViewController ()<UITableViewDelegate, UITableViewDataSource, XPNewHomePlayTableViewCellDelegate, XPHomeBannerTableViewCellDelegate,XPNewHomeRecommendTableViewCellDelegate,XPNewHomeRecommendProtocol>
|
||||
{
|
||||
NSTimer * timer;
|
||||
}
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///轮播图
|
||||
@property (nonatomic,strong) NSArray<HomeBannerInfoModel *> *bannerList;
|
||||
///推荐房
|
||||
@property (nonatomic,strong) NSArray<HomeRecommendRoomModel *> *recommendList;
|
||||
|
||||
|
||||
///组队开黑
|
||||
@property (nonatomic,strong) NSArray<HomePlayRoomModel *> *playTeamList;
|
||||
///个人房列表数据
|
||||
@@ -112,12 +110,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
// 并行队列
|
||||
dispatch_queue_t queue =dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0);
|
||||
|
||||
dispatch_group_enter(group);
|
||||
dispatch_group_async(group, queue, ^{
|
||||
|
||||
[self.presenter getHomeRecommendRoomListWithGroup:group];
|
||||
|
||||
});
|
||||
|
||||
dispatch_group_enter(group);
|
||||
dispatch_group_async(group, queue, ^{
|
||||
|
||||
@@ -130,18 +123,8 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
[self.presenter getHomePersonalRoomListWithGroup:group];
|
||||
|
||||
});
|
||||
dispatch_group_enter(group);
|
||||
dispatch_group_async(group, queue, ^{
|
||||
|
||||
[self.presenter getHomeTopBannerListWithGroup:group];
|
||||
|
||||
});
|
||||
dispatch_group_enter(group);
|
||||
dispatch_group_async(group, queue, ^{
|
||||
|
||||
[self getRoomInfoWithGroup:group];
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
dispatch_group_notify(group,dispatch_get_main_queue(), ^{
|
||||
@@ -156,16 +139,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
self.isRequestData = NO;
|
||||
[self requestData];
|
||||
}
|
||||
-(void)getRoomInfoWithGroup:(dispatch_group_t)group{
|
||||
NSString* roomUid = [AccountInfoStorage instance].getUid;
|
||||
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
||||
self.roomInfo = roomInfo;
|
||||
}
|
||||
dispatch_group_leave(group);
|
||||
} uid:roomUid intoUid:roomUid];
|
||||
}
|
||||
|
||||
- (void)initHeaderAndFooterRrfresh {
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
||||
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
|
||||
@@ -190,127 +164,73 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
[self requestData];
|
||||
}
|
||||
#pragma mark - UITableViewDelegate And UITableViewDataSource
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
return 4;
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 2;
|
||||
}
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
if (section == 0) {
|
||||
return self.recommendList.count > 0 ? 1 : 0;
|
||||
} else if(section == 1) {
|
||||
return self.bannerList.count > 0 ? 1 : 0;
|
||||
} else if(section == 2) {
|
||||
return self.recommendList != nil ? 1 : 0;
|
||||
} else {
|
||||
return self.personalRoomList.count > 0 ? self.personalRoomList.count : 0;
|
||||
}
|
||||
if(section == 0)return self.playTeamList.count > 0 ? 1 : 0;
|
||||
return self.personalRoomList.count > 0 ? self.personalRoomList.count : 1;
|
||||
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (indexPath.section == 0) {
|
||||
return 160 * kScreenScale;
|
||||
} else if(indexPath.section == 1) {
|
||||
return 96;
|
||||
} else if(indexPath.section == 2) {
|
||||
return 65;
|
||||
} else {
|
||||
return 94;
|
||||
return kGetScaleWidth(102);
|
||||
}
|
||||
return self.personalRoomList.count > 0 ? kGetScaleWidth(104) : 300;
|
||||
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (indexPath.section == 0) {
|
||||
XPNewHomeRecommendTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPNewHomeRecommendTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPNewHomeRecommendTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomeRecommendTableViewCell class])];
|
||||
}
|
||||
[cell setRecommendsList:self.recommendList];
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
} else if(indexPath.section == 1) {
|
||||
XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPHomeBannerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
||||
}
|
||||
cell.bannerList = self.bannerList;
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
} else if(indexPath.section == 2) {
|
||||
if (self.playTeamList.count > 0) {
|
||||
if(indexPath.section == 0) {
|
||||
XPNewHomePlayTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPNewHomePlayTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPNewHomePlayTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomePlayTableViewCell class])];
|
||||
}
|
||||
// cell.isClan = self.roomInfo.isPermitRoom == PermitRoomType_Licnese;
|
||||
cell.isClan = YES;
|
||||
|
||||
|
||||
cell.playRoomList = self.playTeamList;
|
||||
|
||||
cell.delegate = self;
|
||||
|
||||
return cell;
|
||||
} else {
|
||||
XPNewHomePlayEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPNewHomePlayEmptyTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPNewHomePlayEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomePlayEmptyTableViewCell class])];
|
||||
}
|
||||
|
||||
// cell.isClan = self.roomInfo.isPermitRoom == PermitRoomType_Licnese;
|
||||
cell.isClan = YES;
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
|
||||
}
|
||||
|
||||
if(self.personalRoomList.count == 0){
|
||||
XPNewHomePlayEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPNewHomePlayEmptyTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPNewHomePlayEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomePlayEmptyTableViewCell class])];
|
||||
}
|
||||
} else {
|
||||
|
||||
[cell setConstraints];
|
||||
[cell setTitle:YMLocalizedString(@"XPGuildEmptyCollectionViewCell0")];
|
||||
return cell;
|
||||
}
|
||||
|
||||
XPNewHomePartyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPNewHomePartyTableViewCell class])];
|
||||
if (cell == nil) {
|
||||
cell = [[XPNewHomePartyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPNewHomePartyTableViewCell class])];
|
||||
}
|
||||
cell.roomInfo = [self.personalRoomList safeObjectAtIndex1:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
|
||||
if(section == 0){return 5;}
|
||||
if (section == 2) {
|
||||
return 50;
|
||||
}else if (section == 3){
|
||||
return 50;
|
||||
}
|
||||
|
||||
return 0.01;
|
||||
}
|
||||
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
|
||||
UIView * view = [[UIView alloc] init];
|
||||
if(self.recommendList == nil && section == 2)return view;
|
||||
if(self.personalRoomList == nil && section == 3)return view;
|
||||
if (section == 2 || section == 3) {
|
||||
view.frame = CGRectMake(0,0, KScreenWidth, 50);
|
||||
|
||||
UILabel * label = [[UILabel alloc] init];
|
||||
label.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
label.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
|
||||
if (section == 2) {
|
||||
label.text = YMLocalizedString(@"XPHomeRecommendViewController0");
|
||||
} else {
|
||||
label.text = YMLocalizedString(@"XPHomeRecommendViewController1");
|
||||
}
|
||||
[view addSubview:label];
|
||||
|
||||
[label mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(16);
|
||||
make.left.mas_equalTo(view).offset(15);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
|
||||
return 0.01;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
|
||||
return [UIView new];
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
@@ -374,25 +294,19 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
}
|
||||
}
|
||||
#pragma mark - XPHomeRecommendProtocol
|
||||
- (void)getHomeTopBannerListSuccess:(NSArray *)list menuList:(NSArray *)memuList withGroup:(nonnull dispatch_group_t)group{
|
||||
self.bannerList = list;
|
||||
dispatch_group_leave(group);
|
||||
}
|
||||
|
||||
|
||||
///推荐
|
||||
- (void)getHomeRecommendRoomListSuccess:(NSArray *)list withGroup:(nonnull dispatch_group_t)group{
|
||||
self.recommendList= list;
|
||||
dispatch_group_leave(group);
|
||||
|
||||
}
|
||||
///房间派对
|
||||
- (void)getHomePersonalRoomListSuccess:(NSArray *)list withGroup:(nonnull dispatch_group_t)group {
|
||||
NSMutableArray * array = [NSMutableArray array];
|
||||
for (HomePlayRoomModel * info in list) {
|
||||
if(info.isBanner) {
|
||||
self.bannerList = info.bannerVoList;
|
||||
} else {
|
||||
[array addObject:info];
|
||||
}
|
||||
|
||||
[array addObject:info];
|
||||
|
||||
}
|
||||
self.personalRoomList = array;
|
||||
dispatch_group_leave(group);
|
||||
@@ -401,11 +315,9 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
- (void)getPlayGameWithTeamSuccess:(NSArray *)list withGroup:(nonnull dispatch_group_t)group{
|
||||
NSMutableArray * array = [NSMutableArray array];
|
||||
for (HomePlayRoomModel * info in list) {
|
||||
if(info.isBanner) {
|
||||
self.bannerList = info.bannerVoList;
|
||||
} else {
|
||||
[array addObject:info];
|
||||
}
|
||||
|
||||
[array addObject:info];
|
||||
|
||||
}
|
||||
self.playTeamList = array;
|
||||
dispatch_group_leave(group);
|
||||
@@ -438,20 +350,17 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
if (@available(iOS 11.0, *)) {
|
||||
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
[_tableView registerClass:[XPNewHomeRecommendTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPNewHomeRecommendTableViewCell class])];
|
||||
[_tableView registerClass:[XPNewHomePlayTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPNewHomePlayTableViewCell class])];
|
||||
[_tableView registerClass:[XPNewHomePlayEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPNewHomePlayEmptyTableViewCell class])];
|
||||
[_tableView registerClass:[XPHomeBannerTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
||||
[_tableView registerClass:[XPNewHomePartyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPNewHomePartyTableViewCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
|
@@ -22,7 +22,11 @@
|
||||
#import "NSArray+Safe.h"
|
||||
///Model
|
||||
#import "HomeTagModel.h"
|
||||
|
||||
#import "XPLittleGameRoomOpenView.h"
|
||||
|
||||
#import "PIHomeItemModel.h"
|
||||
|
||||
///View
|
||||
#import "XPRoomSearchContainerViewController.h"
|
||||
#import "XPHomePartyViewController.h"
|
||||
@@ -41,7 +45,7 @@
|
||||
UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
||||
UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
|
||||
@interface XPNewHomeViewController ()<JXPagerViewDelegate,JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate, XPHomeContainerProtocol, XPNewHomeNavViewDelegate>
|
||||
@interface XPNewHomeViewController ()<JXPagerViewDelegate,JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate, XPHomeContainerProtocol, XPNewHomeNavViewDelegate,XPNewHomeHeadViewDelegate>
|
||||
///背景
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///导航
|
||||
@@ -159,6 +163,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
- (void)initHttp {
|
||||
[self.presenter getHomeTagList];
|
||||
[self.presenter getHomeTopBannerList];
|
||||
[self.presenter getCurrentResourceList];
|
||||
}
|
||||
|
||||
|
||||
@@ -201,38 +206,6 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
[self.navigationController presentViewController:searchVC animated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - JXCategoryViewDelegate
|
||||
//- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
|
||||
// return self.titles.count;
|
||||
//}
|
||||
//
|
||||
//- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
|
||||
// HomeTagModel * hometag = [self.tagList safeObjectAtIndex1:index];
|
||||
//
|
||||
// UIViewController<JXCategoryListContentViewDelegate> * list = (UIViewController<JXCategoryListContentViewDelegate> *)[self.contentView.validListDict objectForKey:[NSNumber numberWithInteger:index]];
|
||||
// if (list) {
|
||||
// return list;
|
||||
// } else {
|
||||
// if ([hometag.name isEqualToString:YMLocalizedString(@"XPNewHomeViewController0")]) {
|
||||
// XPHomeRecommendViewController * recommendVC = [[XPHomeRecommendViewController alloc] init];
|
||||
// return recommendVC;
|
||||
// } else {
|
||||
// XPHomePartyViewController * homeVC = [[XPHomePartyViewController alloc] init];
|
||||
// homeVC.pi_tabId = hometag.tid;
|
||||
// return homeVC;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//
|
||||
//
|
||||
//- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
// HomeTagModel * hometag = [self.tagList safeObjectAtIndex1:index];
|
||||
// if (![hometag.name isEqualToString:YMLocalizedString(@"XPNewHomeViewController1")]) {
|
||||
// XPHomePartyViewController * list = (XPHomePartyViewController<JXCategoryListContentViewDelegate> *)[self.contentView.validListDict objectForKey:[NSNumber numberWithInteger:index]];;
|
||||
// list.pi_tabId = hometag.tid;
|
||||
// }
|
||||
//}
|
||||
#pragma mark - JXCategoryViewDelegate
|
||||
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
|
||||
if(self.headView.bannerList.count == 0)return kGetScaleWidth(103);
|
||||
@@ -260,12 +233,12 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
return homeV;
|
||||
}
|
||||
if (index == 0) {
|
||||
XPHomePartyViewController * homeVC = [[XPHomePartyViewController alloc] init];
|
||||
return homeVC;
|
||||
|
||||
} else {
|
||||
XPHomeRecommendViewController * recommendVC = [[XPHomeRecommendViewController alloc] init];
|
||||
return recommendVC;
|
||||
} else {
|
||||
XPHomePartyViewController * homeVC = [[XPHomePartyViewController alloc] init];
|
||||
|
||||
return homeVC;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -297,6 +270,9 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
[self.pagingView reloadData];
|
||||
[self.pagingView resizeTableHeaderViewHeightWithAnimatable:NO duration:0 curve:0];
|
||||
}
|
||||
- (void)getCurrentResourceListSuccess:(NSArray *)list{
|
||||
self.headView.itemList = list;
|
||||
}
|
||||
- (void)getHomeTagListSuccess:(NSArray<HomeTagModel *> *)array {
|
||||
// [self.tagList addObject:self.recommendItem];
|
||||
// [self.tagList addObjectsFromArray:array];
|
||||
@@ -313,6 +289,38 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
}
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index{
|
||||
self.titleView.index = (int)index;
|
||||
self.titleView.defaultSelectedIndex = index;
|
||||
[self.titleView reloadData];
|
||||
|
||||
}
|
||||
#pragma mark - XPNewHomeHeadViewDelegate
|
||||
///选择
|
||||
-(void)selectItemWithModel:(PIHomeItemModel *)model{
|
||||
if (model.resourceType == HomeMenuResourceType_H5) {
|
||||
XPWebViewController * webVC = [[ XPWebViewController alloc] init];
|
||||
webVC.url = model.resourceContent;
|
||||
[self.navigationController pushViewController:webVC animated:YES];
|
||||
}
|
||||
}
|
||||
-(void)selectBannerListWithModel:(HomeBannerInfoModel *)model{
|
||||
switch (model.skipType) {
|
||||
case HomeBannerInfoSkipType_Room:
|
||||
{
|
||||
if (model.skipUri.length > 0) {
|
||||
[XPRoomViewController openRoom:model.skipUri viewController:self];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HomeBannerInfoSkipType_Web:
|
||||
{
|
||||
XPWebViewController *vc = [[XPWebViewController alloc]init];
|
||||
vc.url = model.skipUri;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (PIHoemCategoryTitleView *)titleView {
|
||||
@@ -325,7 +333,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
_titleView.titleSelectedColor = [UIColor clearColor];
|
||||
_titleView.titleFont = kFontSemibold(16);
|
||||
_titleView.titleSelectedFont = kFontRegular(14);
|
||||
_titleView. titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
|
||||
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
|
||||
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
|
||||
_titleView.defaultSelectedIndex = 0;
|
||||
|
||||
@@ -394,6 +402,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
- (XPNewHomeHeadView *)headView{
|
||||
if(!_headView){
|
||||
_headView = [[XPNewHomeHeadView alloc]initWithFrame:CGRectZero];
|
||||
_headView.delegate = self;
|
||||
}
|
||||
return _headView;
|
||||
}
|
||||
|
BIN
YuMi/Resources/home_heat.gif
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
YuMi/Resources/home_sound_wave.gif
Normal file
After Width: | Height: | Size: 4.4 KiB |
@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface UILabel (Utils)
|
||||
+(UILabel *)labelInitWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor;
|
||||
+ (CGFloat)getLabelHeightWithText:(NSString *)text width:(CGFloat)width font:(UIFont *)font;
|
||||
+ (CGFloat)getWidthWithText:(NSString *)text height:(CGFloat)height font:(UIFont *)font;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -21,4 +21,50 @@
|
||||
}
|
||||
return label;
|
||||
}
|
||||
/**
|
||||
根据宽度求高度
|
||||
@param text 计算的内容
|
||||
@param width 计算的宽度
|
||||
@param font font字体大小
|
||||
@return 放回label的高度
|
||||
*/
|
||||
|
||||
+ (CGFloat)getLabelHeightWithText:(NSString *)text width:(CGFloat)width font: (UIFont *)font
|
||||
|
||||
{
|
||||
|
||||
CGRect rect = [text boundingRectWithSize:CGSizeMake(width, MAXFLOAT)
|
||||
|
||||
options:NSStringDrawingUsesLineFragmentOrigin
|
||||
|
||||
attributes:@{NSFontAttributeName:font} context:nil];
|
||||
|
||||
|
||||
|
||||
return rect.size.height;
|
||||
|
||||
}
|
||||
/**
|
||||
根据高度求宽度
|
||||
@param text 计算的内容
|
||||
@param height 计算的高度
|
||||
@param font font字体大小
|
||||
@return 返回Label的宽度
|
||||
*/
|
||||
|
||||
+ (CGFloat)getWidthWithText:(NSString *)text height:(CGFloat)height font:(UIFont *)font{
|
||||
|
||||
|
||||
|
||||
CGRect rect = [text boundingRectWithSize:CGSizeMake(MAXFLOAT, height)
|
||||
|
||||
options:NSStringDrawingUsesLineFragmentOrigin
|
||||
|
||||
attributes:@{NSFontAttributeName:font}
|
||||
|
||||
context:nil];
|
||||
|
||||
return rect.size.width;
|
||||
|
||||
}
|
||||
@end
|
||||
|