diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 4da1d625..5039960e 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -457,8 +457,6 @@ E8A6C29B27CF53BF00AC7442 /* XPHomeLikePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C29A27CF53BF00AC7442 /* XPHomeLikePresenter.m */; }; E8A6C29F27CF5FE500AC7442 /* HomeLiveRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C29E27CF5FE500AC7442 /* HomeLiveRoomModel.m */; }; E8A6C2A227CF856E00AC7442 /* HomeCollectRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C2A127CF856E00AC7442 /* HomeCollectRoomModel.m */; }; - E8AA6EEF27DF1E6B009B4C2B /* XPRoomTopicViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AA6EEE27DF1E6B009B4C2B /* XPRoomTopicViewController.m */; }; - E8AA6EF227DF1E97009B4C2B /* XPRoomTopicPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AA6EF127DF1E97009B4C2B /* XPRoomTopicPresenter.m */; }; E8A86DF727BA2F1C001C21F9 /* XPRoomLittleGameContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A86DF627BA2F1C001C21F9 /* XPRoomLittleGameContainerView.m */; }; E8A86E0427BA38DB001C21F9 /* SudCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A86DF927BA38DB001C21F9 /* SudCommon.m */; }; E8A86E0527BA38DB001C21F9 /* NSString+RW.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A86DFC27BA38DB001C21F9 /* NSString+RW.m */; }; @@ -467,6 +465,8 @@ E8A86E0827BA38DB001C21F9 /* UIImage+RW.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A86E0127BA38DB001C21F9 /* UIImage+RW.m */; }; E8A86E0D27BA6B71001C21F9 /* SudMGP.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8A86E0A27BA3943001C21F9 /* SudMGP.xcframework */; }; E8A86E0E27BA6B71001C21F9 /* SudMGP.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E8A86E0A27BA3943001C21F9 /* SudMGP.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + E8AA6EEF27DF1E6B009B4C2B /* XPRoomTopicViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AA6EEE27DF1E6B009B4C2B /* XPRoomTopicViewController.m */; }; + E8AA6EF227DF1E97009B4C2B /* XPRoomTopicPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AA6EF127DF1E97009B4C2B /* XPRoomTopicPresenter.m */; }; E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC720F26F43955007D6E91 /* UIImageConstant.m */; }; E8AC721326F46ADD007D6E91 /* XPMineSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC721226F46ADD007D6E91 /* XPMineSettingViewController.m */; }; E8AC721626F46B06007D6E91 /* XPMineSettingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC721526F46B06007D6E91 /* XPMineSettingTableViewCell.m */; }; @@ -592,6 +592,10 @@ E8EEB91426FC7786007C6EBA /* XPMineUserInfoNickViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8EEB91326FC7786007C6EBA /* XPMineUserInfoNickViewController.m */; }; E8EEB91726FC7B35007C6EBA /* XPMineUserInfoDesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8EEB91626FC7B35007C6EBA /* XPMineUserInfoDesViewController.m */; }; E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8EEB91C26FC9D58007C6EBA /* XPMineUserInfoDateView.m */; }; + E8F9168427EC913C00F10D8F /* XPHomeLittleGameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168327EC913C00F10D8F /* XPHomeLittleGameViewController.m */; }; + E8F9168727EC927C00F10D8F /* XPHomeLittleGamePesenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168627EC927C00F10D8F /* XPHomeLittleGamePesenter.m */; }; + E8F9168B27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */; }; + E8F9168E27ECA69500F10D8F /* HomeLittleGameRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168D27ECA69500F10D8F /* HomeLittleGameRoomModel.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -1497,11 +1501,6 @@ E8A6C29E27CF5FE500AC7442 /* HomeLiveRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeLiveRoomModel.m; sourceTree = ""; }; E8A6C2A027CF856E00AC7442 /* HomeCollectRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeCollectRoomModel.h; sourceTree = ""; }; E8A6C2A127CF856E00AC7442 /* HomeCollectRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeCollectRoomModel.m; sourceTree = ""; }; - E8AA6EED27DF1E6B009B4C2B /* XPRoomTopicViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicViewController.h; sourceTree = ""; }; - E8AA6EEE27DF1E6B009B4C2B /* XPRoomTopicViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTopicViewController.m; sourceTree = ""; }; - E8AA6EF027DF1E97009B4C2B /* XPRoomTopicPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicPresenter.h; sourceTree = ""; }; - E8AA6EF127DF1E97009B4C2B /* XPRoomTopicPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTopicPresenter.m; sourceTree = ""; }; - E8AA6EF327DF1EB6009B4C2B /* XPRoomTopicProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicProtocol.h; sourceTree = ""; }; E8A86DF527BA2F1C001C21F9 /* XPRoomLittleGameContainerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomLittleGameContainerView.h; sourceTree = ""; }; E8A86DF627BA2F1C001C21F9 /* XPRoomLittleGameContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomLittleGameContainerView.m; sourceTree = ""; }; E8A86DF927BA38DB001C21F9 /* SudCommon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SudCommon.m; sourceTree = ""; }; @@ -1516,6 +1515,11 @@ E8A86E0327BA38DB001C21F9 /* NSData+RW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+RW.h"; sourceTree = ""; }; E8A86E0A27BA3943001C21F9 /* SudMGP.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = SudMGP.xcframework; sourceTree = ""; }; E8A86E0C27BA3DF4001C21F9 /* SudGameConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SudGameConfig.h; sourceTree = ""; }; + E8AA6EED27DF1E6B009B4C2B /* XPRoomTopicViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicViewController.h; sourceTree = ""; }; + E8AA6EEE27DF1E6B009B4C2B /* XPRoomTopicViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTopicViewController.m; sourceTree = ""; }; + E8AA6EF027DF1E97009B4C2B /* XPRoomTopicPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicPresenter.h; sourceTree = ""; }; + E8AA6EF127DF1E97009B4C2B /* XPRoomTopicPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTopicPresenter.m; sourceTree = ""; }; + E8AA6EF327DF1EB6009B4C2B /* XPRoomTopicProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicProtocol.h; sourceTree = ""; }; E8AC720E26F43955007D6E91 /* UIImageConstant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIImageConstant.h; sourceTree = ""; }; E8AC720F26F43955007D6E91 /* UIImageConstant.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIImageConstant.m; sourceTree = ""; }; E8AC721126F46ADD007D6E91 /* XPMineSettingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineSettingViewController.h; sourceTree = ""; }; @@ -1764,6 +1768,15 @@ E8EEB91626FC7B35007C6EBA /* XPMineUserInfoDesViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoDesViewController.m; sourceTree = ""; }; E8EEB91B26FC9D58007C6EBA /* XPMineUserInfoDateView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoDateView.h; sourceTree = ""; }; E8EEB91C26FC9D58007C6EBA /* XPMineUserInfoDateView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoDateView.m; sourceTree = ""; }; + E8F9168227EC913C00F10D8F /* XPHomeLittleGameViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLittleGameViewController.h; sourceTree = ""; }; + E8F9168327EC913C00F10D8F /* XPHomeLittleGameViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLittleGameViewController.m; sourceTree = ""; }; + E8F9168527EC927C00F10D8F /* XPHomeLittleGamePesenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLittleGamePesenter.h; sourceTree = ""; }; + E8F9168627EC927C00F10D8F /* XPHomeLittleGamePesenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLittleGamePesenter.m; sourceTree = ""; }; + E8F9168827EC928F00F10D8F /* XPHomeLittleGameProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLittleGameProtocol.h; sourceTree = ""; }; + E8F9168927EC940E00F10D8F /* XPHomeLittleGameTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLittleGameTableViewCell.h; sourceTree = ""; }; + E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLittleGameTableViewCell.m; sourceTree = ""; }; + E8F9168C27ECA69500F10D8F /* HomeLittleGameRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeLittleGameRoomModel.h; sourceTree = ""; }; + E8F9168D27ECA69500F10D8F /* HomeLittleGameRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeLittleGameRoomModel.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -4487,6 +4500,8 @@ E8E5E1AE27C3920100F457D8 /* XPHomeRecommendPresenter.m */, E8A6C29927CF53BF00AC7442 /* XPHomeLikePresenter.h */, E8A6C29A27CF53BF00AC7442 /* XPHomeLikePresenter.m */, + E8F9168527EC927C00F10D8F /* XPHomeLittleGamePesenter.h */, + E8F9168627EC927C00F10D8F /* XPHomeLittleGamePesenter.m */, ); path = Presenter; sourceTree = ""; @@ -4499,6 +4514,7 @@ E87A26FA27587C83002DDC7A /* XPHomeContainerProtocol.h */, E8E5E1B027C3920E00F457D8 /* XPHomeRecommendProtocol.h */, E8A6C29C27CF53E100AC7442 /* XPHomeLikeProtocol.h */, + E8F9168827EC928F00F10D8F /* XPHomeLittleGameProtocol.h */, ); path = Protocol; sourceTree = ""; @@ -4524,6 +4540,8 @@ E8A6C29E27CF5FE500AC7442 /* HomeLiveRoomModel.m */, E8A6C2A027CF856E00AC7442 /* HomeCollectRoomModel.h */, E8A6C2A127CF856E00AC7442 /* HomeCollectRoomModel.m */, + E8F9168C27ECA69500F10D8F /* HomeLittleGameRoomModel.h */, + E8F9168D27ECA69500F10D8F /* HomeLittleGameRoomModel.m */, ); path = Model; sourceTree = ""; @@ -4537,6 +4555,8 @@ E8C6FFC527548120004DC9F0 /* XPHomePartyViewController.m */, E8A6C28A27CF436300AC7442 /* XPHomeLikeViewController.h */, E8A6C28B27CF436300AC7442 /* XPHomeLikeViewController.m */, + E8F9168227EC913C00F10D8F /* XPHomeLittleGameViewController.h */, + E8F9168327EC913C00F10D8F /* XPHomeLittleGameViewController.m */, E87A26F427587C48002DDC7A /* XPHomePartyContainerViewController.h */, E87A26F527587C48002DDC7A /* XPHomePartyContainerViewController.m */, E8E5E18927C332EE00F457D8 /* XPHomeViewController.h */, @@ -4595,6 +4615,8 @@ E8A6C29727CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m */, E80CBDEB27D0D899001E1EC2 /* XPHomeLikeEmptyTableViewCell.h */, E80CBDEC27D0D899001E1EC2 /* XPHomeLikeEmptyTableViewCell.m */, + E8F9168927EC940E00F10D8F /* XPHomeLittleGameTableViewCell.h */, + E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */, ); path = Cell; sourceTree = ""; @@ -5183,6 +5205,7 @@ 18E7B22626E8CDCF0064BC9B /* XplanFlutterBoostDelegate.m in Sources */, 9BD9A18427A0F128004186FE /* XPMineVisitorItemModel.m in Sources */, E8EEB8F326FC2050007C6EBA /* SDWaitingView.m in Sources */, + E8F9168B27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m in Sources */, E8DEC9A12764A5D20078CB70 /* XPRoomMoreItemModel.m in Sources */, 18F404B7276095D700A6C548 /* SessionChatLimitView.m in Sources */, E8788942273A55AD00BF1D57 /* XPGiftUsersView.m in Sources */, @@ -5259,6 +5282,7 @@ E8AC721926F46E0B007D6E91 /* XPMineSettingItemModel.m in Sources */, E82325E6274CCAFA003A3332 /* XPShareInfoModel.m in Sources */, 189DD55A26DE39D200AB55B1 /* BaseMvpPresenter.m in Sources */, + E8F9168E27ECA69500F10D8F /* HomeLittleGameRoomModel.m in Sources */, 9BC5C8F9277B02EA007C8719 /* Api+NobleCenter.m in Sources */, 180806D827293794001FD836 /* NSObject+MJExtension.m in Sources */, E88863D3278ED4C0004BCFAB /* Timestamp.m in Sources */, @@ -5470,6 +5494,7 @@ E8AC721C26F4720B007D6E91 /* XPMineSettingPresent.m in Sources */, E88B5CA526FB088600DA9178 /* XPMineTeenagerViewController.m in Sources */, E80CBDF027D0E2C8001E1EC2 /* XPHomeRecommendOtherRoomView.m in Sources */, + E8F9168427EC913C00F10D8F /* XPHomeLittleGameViewController.m in Sources */, E8E5E1B327C397A400F457D8 /* HomeMenuInfoModel.m in Sources */, E8AEAEF027141C430017FCE0 /* XPRoomMenuContainerView.m in Sources */, E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */, @@ -5552,6 +5577,7 @@ 187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */, E896EFA92771AEEC00AD2CC1 /* XPMineAttentionTableViewCell.m in Sources */, 9BBC02912786FC570007C24B /* XPMineNobleCardTableViewCell.m in Sources */, + E8F9168727EC927C00F10D8F /* XPHomeLittleGamePesenter.m in Sources */, E8AC722126F47E23007D6E91 /* XPMineAboutUsViewController.m in Sources */, 18F403CB2758C66800A6C548 /* MessageContentText.m in Sources */, E8232600274E48EA003A3332 /* XPUserCardItemCollectionViewCell.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/Contents.json new file mode 100644 index 00000000..d5fcb900 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_party_little_game_content_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_party_little_game_content_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/home_party_little_game_content_bg@2x.png b/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/home_party_little_game_content_bg@2x.png new file mode 100644 index 00000000..f5872756 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/home_party_little_game_content_bg@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/home_party_little_game_content_bg@3x.png b/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/home_party_little_game_content_bg@3x.png new file mode 100644 index 00000000..cb31952a Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_little_game_content_bg.imageset/home_party_little_game_content_bg@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/Contents.json new file mode 100644 index 00000000..fd19ff69 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_party_little_game_cover@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_party_little_game_cover@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/home_party_little_game_cover@2x.png b/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/home_party_little_game_cover@2x.png new file mode 100644 index 00000000..2293a9e3 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/home_party_little_game_cover@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/home_party_little_game_cover@3x.png b/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/home_party_little_game_cover@3x.png new file mode 100644 index 00000000..28bc211f Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_little_game_cover.imageset/home_party_little_game_cover@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/Contents.json new file mode 100644 index 00000000..3d84827e --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_party_little_game_enter@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_party_little_game_enter@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/home_party_little_game_enter@2x.png b/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/home_party_little_game_enter@2x.png new file mode 100644 index 00000000..6d9088f2 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/home_party_little_game_enter@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/home_party_little_game_enter@3x.png b/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/home_party_little_game_enter@3x.png new file mode 100644 index 00000000..3e4ae234 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_little_game_enter.imageset/home_party_little_game_enter@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/Contents.json new file mode 100644 index 00000000..cb177b5f --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_party_little_game_match@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_party_little_game_match@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/home_party_little_game_match@2x.png b/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/home_party_little_game_match@2x.png new file mode 100644 index 00000000..8fcae567 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/home_party_little_game_match@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/home_party_little_game_match@3x.png b/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/home_party_little_game_match@3x.png new file mode 100644 index 00000000..9ac929f2 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_little_game_match.imageset/home_party_little_game_match@3x.png differ diff --git a/xplan-ios/Main/Home/Api/Api+Home.h b/xplan-ios/Main/Home/Api/Api+Home.h index f387001f..cca12a6f 100644 --- a/xplan-ios/Main/Home/Api/Api+Home.h +++ b/xplan-ios/Main/Home/Api/Api+Home.h @@ -93,6 +93,18 @@ NS_ASSUME_NONNULL_BEGIN /// @param rid 进入的类型的id + (void)homePickResource:(HttpRequestHelperCompletion)completion uid:(NSString *)uid rid:(NSString *)rid; +/// 首页小游戏列表 +/// @param completion 完成 +/// @param pageSize 一页多少个 +/// @param pageNum 多少页 +/// @param uid 用户的uid ++ (void)homeLittleGameRoomList:(HttpRequestHelperCompletion)completion pageSize:(NSString *)pageSize pageNum:(NSString *)pageNum uid:(NSString *)uid; + +/// 快速匹配 +/// @param completion 完成 +/// @param uid 用户的uid ++ (void)homeQuickMatchLittleGame:(HttpRequestHelperCompletion)completion uid:(NSString *)uid; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/Api/Api+Home.m b/xplan-ios/Main/Home/Api/Api+Home.m index b3450d0c..10b14850 100644 --- a/xplan-ios/Main/Home/Api/Api+Home.m +++ b/xplan-ios/Main/Home/Api/Api+Home.m @@ -111,4 +111,22 @@ [HttpRequestHelper request:@"home/pickResource" method:HttpRequestHelperMethodGET params:dic completion:completion]; } + +/// 首页小游戏列表 +/// @param completion 完成 +/// @param pageSize 一页多少个 +/// @param pageNum 多少页 +/// @param uid 用户的uid ++ (void)homeLittleGameRoomList:(HttpRequestHelperCompletion)completion pageSize:(NSString *)pageSize pageNum:(NSString *)pageNum uid:(NSString *)uid { + [self makeRequest:@"home/miniGameTabList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, pageSize, pageNum, uid, nil]; +} + + +/// 快速匹配 +/// @param completion 完成 +/// @param uid 用户的uid ++ (void)homeQuickMatchLittleGame:(HttpRequestHelperCompletion)completion uid:(NSString *)uid { + [self makeRequest:@"home/fastPick" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil]; +} + @end diff --git a/xplan-ios/Main/Home/Model/HomeLittleGameRoomModel.h b/xplan-ios/Main/Home/Model/HomeLittleGameRoomModel.h new file mode 100644 index 00000000..06630538 --- /dev/null +++ b/xplan-ios/Main/Home/Model/HomeLittleGameRoomModel.h @@ -0,0 +1,40 @@ +// +// HomeLittleGameRoomModel.h +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class HomeLittleGameMicUserModel; +@interface HomeLittleGameRoomModel : NSObject +///头像 +@property (nonatomic, copy) NSString *avatar; +///小游戏ID +@property(nonatomic, copy) NSString *mgId; +///小游戏名称 +@property(nonatomic, copy) NSString *mgName; +///麦上用户 +@property (nonatomic, strong) NSArray *micUsers; +///在线人数 +@property (nonatomic, assign) NSInteger onlineNum; +///房间标题 +@property (nonatomic, copy) NSString *title; +///房主的uid +@property (nonatomic,copy) NSString *uid; +///房间小游戏状态:1-游戏进行中,2-等人中 +@property (nonatomic, assign) NSInteger state; +@end + +@interface HomeLittleGameMicUserModel : NSObject +///头像 +@property (nonatomic, copy) NSString *avatar; +///姓名 +@property (nonatomic,copy) NSString *nick; +///用户的uid +@property (nonatomic,copy) NSString *uid; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/Model/HomeLittleGameRoomModel.m b/xplan-ios/Main/Home/Model/HomeLittleGameRoomModel.m new file mode 100644 index 00000000..983e4bba --- /dev/null +++ b/xplan-ios/Main/Home/Model/HomeLittleGameRoomModel.m @@ -0,0 +1,24 @@ +// +// HomeLittleGameRoomModel.m +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import "HomeLittleGameRoomModel.h" + +@implementation HomeLittleGameRoomModel ++ (NSDictionary *)objectClassInArray { + return @{ + @"micUsers": [HomeLittleGameMicUserModel class] + }; +} + +@end + + +@implementation HomeLittleGameMicUserModel + + + +@end diff --git a/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.h b/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.h new file mode 100644 index 00000000..f22acdc2 --- /dev/null +++ b/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.h @@ -0,0 +1,18 @@ +// +// XPHomeLittleGamePesenter.h +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import "BaseMvpPresenter.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPHomeLittleGamePesenter : BaseMvpPresenter +- (void)getHomeLittleGameRoomList:(int)pageNum pageSize:(int)pageSize state:(int)state; + +- (void)quickMatchLittleGameRoom; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.m b/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.m new file mode 100644 index 00000000..5f7d340e --- /dev/null +++ b/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.m @@ -0,0 +1,38 @@ +// +// XPHomeLittleGamePesenter.m +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import "XPHomeLittleGamePesenter.h" +#import "AccountInfoStorage.h" +#import "XPHomeLittleGameProtocol.h" +#import "Api+Home.h" +#import "HomeLittleGameRoomModel.h" + +@implementation XPHomeLittleGamePesenter + +- (void)getHomeLittleGameRoomList:(int)pageNum pageSize:(int)pageSize state:(int)state { + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * pageNumStr = [NSString stringWithFormat:@"%d", pageNum]; + NSString * pageSizeStr = [NSString stringWithFormat:@"%d", pageSize]; + [Api homeLittleGameRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + NSArray * array = [HomeLittleGameRoomModel modelsWithArray:data.data]; + [[self getView] getHomeLittleGameRoomListSuccess:array state:state]; + }fail:^(NSInteger code, NSString * _Nullable msg) { + [[self getView] getHomeLittleGameRoomListFail:msg state:state]; + }] pageSize:pageSizeStr pageNum:pageNumStr uid:uid]; +} + + +- (void)quickMatchLittleGameRoom { + NSString * uid = [AccountInfoStorage instance].getUid; + [Api homeQuickMatchLittleGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + HomeLittleGameRoomModel * gameRoom = [HomeLittleGameRoomModel modelWithDictionary:data.data]; + NSString * uid = gameRoom.uid; + [[self getView] quickMatchLittleGameRoomSuccess:uid]; + } showLoading:YES] uid:uid]; +} + +@end diff --git a/xplan-ios/Main/Home/Protocol/XPHomeLittleGameProtocol.h b/xplan-ios/Main/Home/Protocol/XPHomeLittleGameProtocol.h new file mode 100644 index 00000000..5974dbcb --- /dev/null +++ b/xplan-ios/Main/Home/Protocol/XPHomeLittleGameProtocol.h @@ -0,0 +1,20 @@ +// +// XPHomeLittleGameProtocol.h +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol XPHomeLittleGameProtocol + +- (void)getHomeLittleGameRoomListSuccess:(NSArray *)array state:(int)state; +- (void)getHomeLittleGameRoomListFail:(NSString *)message state:(int)state; +///匹配成功 +- (void)quickMatchLittleGameRoomSuccess:(NSString *)uid; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/Cell/XPHomeLittleGameTableViewCell.h b/xplan-ios/Main/Home/View/Cell/XPHomeLittleGameTableViewCell.h new file mode 100644 index 00000000..b1083780 --- /dev/null +++ b/xplan-ios/Main/Home/View/Cell/XPHomeLittleGameTableViewCell.h @@ -0,0 +1,16 @@ +// +// XPHomeLittleGameTableViewCell.h +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class HomeLittleGameRoomModel; +@interface XPHomeLittleGameTableViewCell : UITableViewCell +@property (nonatomic,strong) HomeLittleGameRoomModel *gameInfo; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/Cell/XPHomeLittleGameTableViewCell.m b/xplan-ios/Main/Home/View/Cell/XPHomeLittleGameTableViewCell.m new file mode 100644 index 00000000..f15cb0a2 --- /dev/null +++ b/xplan-ios/Main/Home/View/Cell/XPHomeLittleGameTableViewCell.m @@ -0,0 +1,353 @@ +// +// XPHomeLittleGameTableViewCell.m +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import "XPHomeLittleGameTableViewCell.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "NetImageView.h" +#import "XPMacro.h" +#import "UIImage+Utils.h" +///Model +#import "HomeLittleGameRoomModel.h" + +@interface XPHomeLittleGameTableViewCell () +///头像 +@property (nonatomic,strong) NetImageView *avatarImageView; +///边框 +@property (nonatomic,strong) UIImageView *coverImageView; +///内容 +@property (nonatomic,strong) UIImageView *backImageView; +///房间标题 +@property (nonatomic,strong) UILabel *roomTitleLabel; +///游戏名字 +@property (nonatomic,strong) UILabel *gamenameLabel; +///分割线 +@property (nonatomic,strong) UIView * gameLineView; +///游戏状态 +@property (nonatomic,strong) UILabel *stateLabel; +///进房 +@property (nonatomic,strong) UIButton *enterButton; +///房间在线人数 +@property (nonatomic,strong) UIView *micContainerView; +///第一个 +@property (nonatomic,strong) NetImageView *firstImageView; +///第二个 +@property (nonatomic,strong) NetImageView *secondImageView; +///第三个 +@property (nonatomic,strong) NetImageView *thirdImageView; +///第四个 +@property (nonatomic,strong) NetImageView *fourImageView; +///第五个 +@property (nonatomic,strong) NetImageView *fifImageView; +///用户的数组 +@property (nonatomic,strong) NSArray *micUserArray; +@end + + +@implementation XPHomeLittleGameTableViewCell +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor clearColor]; + self.selectionStyle = UITableViewCellSelectionStyleNone; + [self.contentView addSubview:self.backImageView]; + [self.contentView addSubview:self.avatarImageView]; + [self.contentView addSubview:self.coverImageView]; + + [self.backImageView addSubview:self.roomTitleLabel]; + [self.backImageView addSubview:self.gamenameLabel]; + [self.backImageView addSubview:self.gameLineView]; + [self.backImageView addSubview:self.stateLabel]; + [self.backImageView addSubview:self.micContainerView]; + [self.backImageView addSubview:self.enterButton]; + + [self.micContainerView addSubview:self.fifImageView]; + [self.micContainerView addSubview:self.fourImageView]; + [self.micContainerView addSubview:self.thirdImageView]; + [self.micContainerView addSubview:self.secondImageView]; + [self.micContainerView addSubview:self.firstImageView]; + self.micUserArray = @[self.firstImageView, self.secondImageView, self.thirdImageView, self.fourImageView, self.fifImageView]; +} + +- (void)initSubViewConstraints { + [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(74, 74)); + make.centerY.mas_equalTo(self.contentView).offset(-10); + make.left.mas_equalTo(self.contentView).offset(15); + }]; + + [self.coverImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.avatarImageView); + }]; + + [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.avatarImageView).offset(26); + make.right.mas_equalTo(self.contentView).offset(-15); + make.height.mas_equalTo(98); + make.centerX.mas_equalTo(self.contentView).offset(-10); + }]; + + [self.roomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.backImageView).offset(56); + make.top.mas_equalTo(self.backImageView).offset(15); + }]; + [self.gamenameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.roomTitleLabel); + make.top.mas_equalTo(self.roomTitleLabel.mas_bottom).offset(4); + }]; + + [self.gameLineView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.gamenameLabel.mas_right).offset(4); + make.centerY.mas_equalTo(self.gamenameLabel); + make.size.mas_equalTo(CGSizeMake(1, 9)); + }]; + + [self.stateLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.gamenameLabel); + make.left.mas_equalTo(self.gameLineView.mas_right).offset(4); + }]; + + [self.enterButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(65, 24)); + make.right.mas_equalTo(self.backImageView).offset(-15); + make.top.mas_equalTo(self.backImageView).offset(56); + }]; + + [self.micContainerView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(self.backImageView).offset(-13); + make.height.mas_equalTo(16); + make.top.mas_equalTo(self.gamenameLabel.mas_bottom).offset(10); + make.left.mas_equalTo(self.fifImageView.mas_left).offset(-5); + }]; + + [self.firstImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(16, 16)); + make.right.mas_equalTo(self.micContainerView); + make.centerY.mas_equalTo(self.micContainerView); + }]; + + [self.secondImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.centerY.mas_equalTo(self.firstImageView); + make.right.mas_equalTo(self.firstImageView.mas_left).offset(2); + }]; + + [self.thirdImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.centerY.mas_equalTo(self.firstImageView); + make.right.mas_equalTo(self.secondImageView.mas_left).offset(2); + }]; + + [self.fourImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.centerY.mas_equalTo(self.firstImageView); + make.right.mas_equalTo(self.thirdImageView.mas_left).offset(2); + }]; + + [self.fifImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.centerY.mas_equalTo(self.firstImageView); + make.right.mas_equalTo(self.fourImageView.mas_left).offset(2); + }]; +} +#pragma mark - Getters And Setters +- (void)setGameInfo:(HomeLittleGameRoomModel *)gameInfo { + _gameInfo = gameInfo; + if (_gameInfo) { + self.roomTitleLabel.text = _gameInfo.title; + self.avatarImageView.imageUrl = _gameInfo.avatar; + self.gamenameLabel.text = _gameInfo.mgName; + self.stateLabel.text = _gameInfo.state == 1 ? @"游戏中" : @"等待中"; + if (_gameInfo.micUsers.count > 0) { + self.micContainerView.hidden = NO; + for (NSInteger i = 0; i < self.micUserArray.count; i++) { + NetImageView * imageView = [self.micUserArray objectAtIndex:i]; + if (i< _gameInfo.micUsers.count) { + HomeLittleGameMicUserModel * micUserInfo = [_gameInfo.micUsers objectAtIndex:i]; + imageView.imageUrl = micUserInfo.avatar; + imageView.hidden = NO; + } else { + imageView.hidden = YES; + } + } + } else { + self.micContainerView.hidden = YES; + } + + } +} + + +- (NetImageView *)avatarImageView { + if (!_avatarImageView) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _avatarImageView = [[NetImageView alloc] initWithConfig:config]; + _avatarImageView.layer.masksToBounds = YES; + _avatarImageView.layer.cornerRadius = 8; + } + return _avatarImageView; +} + +- (UIImageView *)coverImageView { + if (!_coverImageView) { + _coverImageView = [[UIImageView alloc] init]; + _coverImageView.userInteractionEnabled = YES; + _coverImageView.image = [UIImage imageNamed:@"home_party_little_game_cover"]; + } + return _coverImageView; +} + + +- (UIImageView *)backImageView { + if (!_backImageView) { + _backImageView = [[UIImageView alloc] init]; + _backImageView.userInteractionEnabled = YES; + _backImageView.image = [UIImage imageNamed:@"home_party_little_game_content_bg"]; + } + return _backImageView; +} + +- (UILabel *)roomTitleLabel { + if (!_roomTitleLabel) { + _roomTitleLabel = [[UILabel alloc] init]; + _roomTitleLabel.font = [UIFont systemFontOfSize:14]; + _roomTitleLabel.textColor = [ThemeColor mainTextColor]; + } + return _roomTitleLabel; +} + +- (UILabel *)gamenameLabel { + if (!_gamenameLabel) { + _gamenameLabel = [[UILabel alloc] init]; + _gamenameLabel.font = [UIFont systemFontOfSize:10]; + } + return _gamenameLabel; +} + +- (UIView *)gameLineView { + if (!_gameLineView) { + _gameLineView = [[UIView alloc] init]; + _gameLineView.backgroundColor = UIColorFromRGB(0xD8D8D8); + } + return _gameLineView; +} + +- (UILabel *)stateLabel { + if (!_stateLabel) { + _stateLabel = [[UILabel alloc] init]; + _stateLabel.font = [UIFont systemFontOfSize:10]; + _stateLabel.textColor = [ThemeColor secondTextColor]; + } + return _stateLabel; +} + + +- (UIButton *)enterButton { + if (!_enterButton) { + _enterButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_enterButton setTitle:@"进房" forState:UIControlStateNormal]; + [_enterButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _enterButton.titleLabel.font = [UIFont systemFontOfSize:15]; + [_enterButton setImage:[UIImage imageNamed:@"home_party_little_game_enter"] forState:UIControlStateNormal]; + [_enterButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xAF7CFF), UIColorFromRGB(0x5D57FD)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + _enterButton.layer.masksToBounds = YES; + _enterButton.layer.cornerRadius = 12; + _enterButton.userInteractionEnabled = NO; + } + return _enterButton; +} + +- (UIView *)micContainerView { + if (!_micContainerView) { + _micContainerView = [[UIView alloc] init]; + _micContainerView.backgroundColor = [UIColor clearColor]; + } + return _micContainerView; +} + +- (NetImageView *)firstImageView { + if (!_firstImageView) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _firstImageView = [[NetImageView alloc] initWithConfig:config]; + _firstImageView.layer.masksToBounds = YES; + _firstImageView.layer.cornerRadius = 8; + _firstImageView.layer.borderColor = [UIColor whiteColor].CGColor; + _firstImageView.layer.borderWidth = 1; + _firstImageView.backgroundColor= [UIColor redColor]; + } + return _firstImageView; +} + +- (NetImageView *)secondImageView { + if (!_secondImageView) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _secondImageView = [[NetImageView alloc] initWithConfig:config]; + _secondImageView.layer.masksToBounds = YES; + _secondImageView.layer.cornerRadius = 8; + _secondImageView.layer.borderColor = [UIColor whiteColor].CGColor; + _secondImageView.layer.borderWidth = 1; + _secondImageView.backgroundColor= [UIColor yellowColor]; + } + return _secondImageView; +} + +- (NetImageView *)thirdImageView { + if (!_thirdImageView) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _thirdImageView = [[NetImageView alloc] initWithConfig:config]; + _thirdImageView.layer.masksToBounds = YES; + _thirdImageView.layer.cornerRadius = 8; + _thirdImageView.layer.borderColor = [UIColor whiteColor].CGColor; + _thirdImageView.layer.borderWidth = 1; + _thirdImageView.backgroundColor= [UIColor blueColor]; + } + return _thirdImageView; +} + +- (NetImageView *)fourImageView { + if (!_fourImageView) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _fourImageView = [[NetImageView alloc] initWithConfig:config]; + _fourImageView.layer.masksToBounds = YES; + _fourImageView.layer.cornerRadius = 8; + _fourImageView.layer.borderColor = [UIColor whiteColor].CGColor; + _fourImageView.layer.borderWidth = 1; + } + return _fourImageView; +} + + +- (NetImageView *)fifImageView { + if (!_fifImageView) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _fifImageView = [[NetImageView alloc] initWithConfig:config]; + _fifImageView.layer.masksToBounds = YES; + _fifImageView.layer.cornerRadius = 8; + _fifImageView.layer.borderColor = [UIColor whiteColor].CGColor; + _fifImageView.layer.borderWidth = 1; + } + return _fifImageView; +} + +@end diff --git a/xplan-ios/Main/Home/View/XPHomeLittleGameViewController.h b/xplan-ios/Main/Home/View/XPHomeLittleGameViewController.h new file mode 100644 index 00000000..4fb720bc --- /dev/null +++ b/xplan-ios/Main/Home/View/XPHomeLittleGameViewController.h @@ -0,0 +1,16 @@ +// +// XPHomeLittleGameViewController.h +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import "MvpViewController.h" +#import +NS_ASSUME_NONNULL_BEGIN + +@interface XPHomeLittleGameViewController : MvpViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPHomeLittleGameViewController.m b/xplan-ios/Main/Home/View/XPHomeLittleGameViewController.m new file mode 100644 index 00000000..ce50408c --- /dev/null +++ b/xplan-ios/Main/Home/View/XPHomeLittleGameViewController.m @@ -0,0 +1,222 @@ +// +// XPHomeLittleGameViewController.m +// xplan-ios +// +// Created by 冯硕 on 2022/3/24. +// + +#import "XPHomeLittleGameViewController.h" +///Third +#import +#import +///Tool +#import "ThemeColor.h" +#import "UIImage+Utils.h" +///Model +#import "HomeLittleGameRoomModel.h" +///View +#import "XPHomeLittleGameTableViewCell.h" +#import "XPHomeListEmptyTableViewCell.h" +///P +#import "XPHomeLittleGamePesenter.h" +#import "XPHomeLittleGameProtocol.h" +#import "XPRoomViewController.h" + +@interface XPHomeLittleGameViewController () +///列表 +@property (nonatomic,strong) UITableView *tableView; +///快速匹配 +@property (nonatomic,strong) UIButton *matchButton; +@property (nonatomic,strong) NSMutableArray *datasource; +@property (nonatomic,assign) int page; +@property (nonatomic,assign) BOOL hasNoMoreData; +@end + +@implementation XPHomeLittleGameViewController + +- (BOOL)isHiddenNavBar { + return YES; +} + +- (XPHomeLittleGamePesenter *)createPresenter { + return [[XPHomeLittleGamePesenter alloc] init];; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self initHeaderAndFooterRrfresh]; + [self initSubViews]; + [self initSubViewConstraints]; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self.view addSubview:self.tableView]; + [self.view addSubview:self.matchButton]; +} + +- (void)initSubViewConstraints { + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.view); + }]; + + [self.matchButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(118, 40)); + make.right.mas_equalTo(self.view).offset(-5); + make.bottom.mas_equalTo(self.view).offset(-20); + }]; +} + +- (void)initHeaderAndFooterRrfresh { + MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; + header.stateLabel.font = [UIFont systemFontOfSize:10.0]; + header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0]; + header.stateLabel.textColor = [ThemeColor secondTextColor]; + header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor]; + self.tableView.mj_header = header; + + MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)]; + footer.stateLabel.textColor = [ThemeColor secondTextColor]; + footer.stateLabel.font = [UIFont systemFontOfSize:10.0]; + self.tableView.mj_footer = footer; + + [self headerRefresh]; +} + +#pragma mark - 刷新的fangfa +- (void)headerRefresh { + self.page = 1; + [self.presenter getHomeLittleGameRoomList:self.page pageSize:20 state:0]; +} + +- (void)footerRefresh { + if (self.hasNoMoreData) { + [self showErrorToast:@"没有更多房间了"]; + [self.tableView.mj_footer endRefreshing]; + return; + } + self.page++; + [self.presenter getHomeLittleGameRoomList:self.page pageSize:20 state:0]; +} +#pragma mark - UITableViewDelegate And UITableViewDataSource +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.datasource.count > 0 ? self.datasource.count : 1; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return self.datasource.count > 0 ? 106 : 500; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + if (self.datasource.count > 0) { + XPHomeLittleGameTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeLittleGameTableViewCell class])]; + if (cell == nil) { + cell = [[XPHomeLittleGameTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeLittleGameTableViewCell class])]; + } + cell.gameInfo = [self.datasource objectAtIndex:indexPath.row]; + return cell; + } + XPHomeListEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])]; + if (cell == nil) { + cell = [[XPHomeListEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])]; + } + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + if (self.datasource.count > 0) { + HomeLittleGameRoomModel * gameInfo = [self.datasource objectAtIndex:indexPath.row]; + if (gameInfo.uid.length > 0) { + [XPRoomViewController openRoom:gameInfo.uid viewController:self]; + } + } +} + +#pragma mark - XPHomeLittleGameProtocol +- (void)quickMatchLittleGameRoomSuccess:(NSString *)uid { + if (uid.length > 0) { + [XPRoomViewController openRoom:uid viewController:self]; + } +} + +- (void)getHomeLittleGameRoomListSuccess:(NSArray *)array state:(int)state { + if (state == 0) { + self.hasNoMoreData = NO; + [self.datasource removeAllObjects]; + [self.tableView.mj_header endRefreshing]; + } else { + [self.tableView.mj_footer endRefreshing]; + } + if (array.count > 0) { + self.hasNoMoreData = NO; + [self.datasource addObjectsFromArray:array]; + } else { + self.hasNoMoreData = YES; + } + [self.tableView reloadData]; +} + +- (void)getHomeLittleGameRoomListFail:(NSString *)message state:(int)state { + if (state) { + [self.tableView.mj_header endRefreshing]; + } else { + [self.tableView.mj_footer endRefreshing]; + } +} + +#pragma mark - JXCategoryListContentViewDelegate +- (UIView *)listView { + return self.view; +} + +#pragma mark - Event Response +- (void)matchButtonAction:(UIButton *)sender { + [self.presenter quickMatchLittleGameRoom]; +} + +#pragma mark - Getters And Setters +- (UITableView *)tableView { + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; + _tableView.delegate = self; + _tableView.dataSource = self; + _tableView.tableFooterView = [UIView new]; + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + _tableView.backgroundColor = [UIColor clearColor]; + if (@available(iOS 11.0, *)) { + _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } + [_tableView registerClass:[XPHomeLittleGameTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeLittleGameTableViewCell class])]; + [_tableView registerClass:[XPHomeListEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])]; + } + return _tableView; +} + +- (UIButton *)matchButton { + if (!_matchButton) { + _matchButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_matchButton setTitle:@"快速匹配" forState:UIControlStateNormal]; + [_matchButton setImage:[UIImage imageNamed:@"home_party_little_game_match"] forState:UIControlStateNormal]; + [_matchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _matchButton.titleLabel.font = [UIFont systemFontOfSize:16]; + [_matchButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + _matchButton.layer.masksToBounds = YES; + _matchButton.layer.cornerRadius = 20; + _matchButton.layer.shadowOffset = CGSizeMake(4, 4); + _matchButton.layer.shadowColor = UIColorRGBAlpha(0xFFAC38, 0.3).CGColor; + _matchButton.layer.opacity = 1; + [_matchButton addTarget:self action:@selector(matchButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _matchButton; +} + +- (NSMutableArray *)datasource { + if (!_datasource) { + _datasource = [NSMutableArray array]; + } + return _datasource; +} + + +@end diff --git a/xplan-ios/Main/Home/View/XPHomePartyContainerViewController.m b/xplan-ios/Main/Home/View/XPHomePartyContainerViewController.m index 5a6e9269..3513ad77 100644 --- a/xplan-ios/Main/Home/View/XPHomePartyContainerViewController.m +++ b/xplan-ios/Main/Home/View/XPHomePartyContainerViewController.m @@ -22,6 +22,7 @@ #import "XPHomePartyViewController.h" #import "XPWebViewController.h" #import "XPHomeLikeViewController.h" +#import "XPHomeLittleGameViewController.h" ///P #import "XPHomeContainerPresenter.h" #import "XPHomeContainerProtocol.h" @@ -95,6 +96,9 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey; XPHomeLikeViewController * likeVC = [[XPHomeLikeViewController alloc] init]; likeVC.delegate = self; return likeVC; + }if ([hometag.name isEqualToString:@"小游戏"]) { + XPHomeLittleGameViewController * likeVC = [[XPHomeLittleGameViewController alloc] init]; + return likeVC; } else { XPHomePartyViewController * homeVC = [[XPHomePartyViewController alloc] init]; homeVC.tabId = hometag.tid; @@ -105,7 +109,7 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey; - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { HomeTagModel * hometag = [self.tagList objectAtIndex:index]; - if (![hometag.name isEqualToString:@"喜欢"]) { + if (![hometag.name isEqualToString:@"喜欢"] && ![hometag.name isEqualToString:@"小游戏"]) { XPHomePartyViewController * list = (XPHomePartyViewController *)[self.contentView.validListDict objectForKey:[NSNumber numberWithInteger:index]];; if ([hometag.name isEqualToString:@"个播"]) { list.isAnchor = YES;