diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 86f38c2f..0e42c31c 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -150,6 +150,15 @@ E874B88827215D39003954B9 /* MicroStateModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B88727215D39003954B9 /* MicroStateModel.m */; }; E874B88B27215EAF003954B9 /* MicroQueueModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B88A27215EAF003954B9 /* MicroQueueModel.m */; }; E87888F42738C30E00BF1D57 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E87888F32738C30E00BF1D57 /* StoreKit.framework */; }; + E8788934273A53D700BF1D57 /* XPSendGiftView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8788933273A53D700BF1D57 /* XPSendGiftView.m */; }; + E878893C273A54C300BF1D57 /* Api+Gift.m in Sources */ = {isa = PBXBuildFile; fileRef = E878893B273A54C300BF1D57 /* Api+Gift.m */; }; + E878893F273A54F500BF1D57 /* XPGiftPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E878893E273A54F500BF1D57 /* XPGiftPresenter.m */; }; + E8788942273A55AD00BF1D57 /* XPGiftUsersView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8788941273A55AD00BF1D57 /* XPGiftUsersView.m */; }; + E8788945273A55C200BF1D57 /* XPGiftInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8788944273A55C200BF1D57 /* XPGiftInfoView.m */; }; + E8788948273A55D000BF1D57 /* XPGiftBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8788947273A55D000BF1D57 /* XPGiftBarView.m */; }; + E878894C273A607C00BF1D57 /* XPGiftUserCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E878894B273A607C00BF1D57 /* XPGiftUserCollectionViewCell.m */; }; + E8788950273A699900BF1D57 /* ThemeColor+SendGift.m in Sources */ = {isa = PBXBuildFile; fileRef = E878894F273A699900BF1D57 /* ThemeColor+SendGift.m */; }; + E8788960273BB14200BF1D57 /* XPGiftMicroUserModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E878895F273BB14200BF1D57 /* XPGiftMicroUserModel.m */; }; E87A24F1272935920086A794 /* XPMessageRemoteExtModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E87A24F0272935920086A794 /* XPMessageRemoteExtModel.m */; }; E88B5CA526FB088600DA9178 /* XPMineTeenagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA426FB088600DA9178 /* XPMineTeenagerViewController.m */; }; E88B5CA826FB089C00DA9178 /* XPMineTeenagePwdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CA726FB089C00DA9178 /* XPMineTeenagePwdViewController.m */; }; @@ -520,6 +529,25 @@ E87888F12738C23F00BF1D57 /* xplan-ios.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "xplan-ios.entitlements"; sourceTree = ""; }; E87888F22738C2D400BF1D57 /* xplan-iosRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "xplan-iosRelease.entitlements"; sourceTree = ""; }; E87888F32738C30E00BF1D57 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; + E8788932273A53D700BF1D57 /* XPSendGiftView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSendGiftView.h; sourceTree = ""; }; + E8788933273A53D700BF1D57 /* XPSendGiftView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSendGiftView.m; sourceTree = ""; }; + E878893A273A54C300BF1D57 /* Api+Gift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+Gift.h"; sourceTree = ""; }; + E878893B273A54C300BF1D57 /* Api+Gift.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+Gift.m"; sourceTree = ""; }; + E878893D273A54F500BF1D57 /* XPGiftPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftPresenter.h; sourceTree = ""; }; + E878893E273A54F500BF1D57 /* XPGiftPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftPresenter.m; sourceTree = ""; }; + E8788940273A55AD00BF1D57 /* XPGiftUsersView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftUsersView.h; sourceTree = ""; }; + E8788941273A55AD00BF1D57 /* XPGiftUsersView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftUsersView.m; sourceTree = ""; }; + E8788943273A55C200BF1D57 /* XPGiftInfoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftInfoView.h; sourceTree = ""; }; + E8788944273A55C200BF1D57 /* XPGiftInfoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftInfoView.m; sourceTree = ""; }; + E8788946273A55D000BF1D57 /* XPGiftBarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftBarView.h; sourceTree = ""; }; + E8788947273A55D000BF1D57 /* XPGiftBarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftBarView.m; sourceTree = ""; }; + E878894A273A607C00BF1D57 /* XPGiftUserCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftUserCollectionViewCell.h; sourceTree = ""; }; + E878894B273A607C00BF1D57 /* XPGiftUserCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftUserCollectionViewCell.m; sourceTree = ""; }; + E878894D273A672200BF1D57 /* XPGiftProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftProtocol.h; sourceTree = ""; }; + E878894E273A699900BF1D57 /* ThemeColor+SendGift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ThemeColor+SendGift.h"; sourceTree = ""; }; + E878894F273A699900BF1D57 /* ThemeColor+SendGift.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ThemeColor+SendGift.m"; sourceTree = ""; }; + E878895E273BB14200BF1D57 /* XPGiftMicroUserModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftMicroUserModel.h; sourceTree = ""; }; + E878895F273BB14200BF1D57 /* XPGiftMicroUserModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftMicroUserModel.m; sourceTree = ""; }; E87A24EF272935920086A794 /* XPMessageRemoteExtModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMessageRemoteExtModel.h; sourceTree = ""; }; E87A24F0272935920086A794 /* XPMessageRemoteExtModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMessageRemoteExtModel.m; sourceTree = ""; }; E88B5CA326FB088600DA9178 /* XPMineTeenagerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineTeenagerViewController.h; sourceTree = ""; }; @@ -1023,6 +1051,7 @@ 189DD56C26DF5B5400AB55B1 /* UI */ = { isa = PBXGroup; children = ( + E8788931273A53B000BF1D57 /* SendGiftView */, E8659640270160F200846EBD /* VagueImageView */, E8AC720A26F435AF007D6E91 /* UIImageView */, E81366F926F0D27A0076364C /* UIButton */, @@ -1444,6 +1473,80 @@ path = Model; sourceTree = ""; }; + E8788931273A53B000BF1D57 /* SendGiftView */ = { + isa = PBXGroup; + children = ( + E8788935273A540400BF1D57 /* Model */, + E8788936273A541500BF1D57 /* Api */, + E8788937273A542700BF1D57 /* View */, + E8788938273A542E00BF1D57 /* Presenter */, + E8788939273A544000BF1D57 /* Protocol */, + E878894E273A699900BF1D57 /* ThemeColor+SendGift.h */, + E878894F273A699900BF1D57 /* ThemeColor+SendGift.m */, + ); + path = SendGiftView; + sourceTree = ""; + }; + E8788935273A540400BF1D57 /* Model */ = { + isa = PBXGroup; + children = ( + E878895E273BB14200BF1D57 /* XPGiftMicroUserModel.h */, + E878895F273BB14200BF1D57 /* XPGiftMicroUserModel.m */, + ); + path = Model; + sourceTree = ""; + }; + E8788936273A541500BF1D57 /* Api */ = { + isa = PBXGroup; + children = ( + E878893A273A54C300BF1D57 /* Api+Gift.h */, + E878893B273A54C300BF1D57 /* Api+Gift.m */, + ); + path = Api; + sourceTree = ""; + }; + E8788937273A542700BF1D57 /* View */ = { + isa = PBXGroup; + children = ( + E8788949273A594C00BF1D57 /* Cell */, + E8788932273A53D700BF1D57 /* XPSendGiftView.h */, + E8788933273A53D700BF1D57 /* XPSendGiftView.m */, + E8788940273A55AD00BF1D57 /* XPGiftUsersView.h */, + E8788941273A55AD00BF1D57 /* XPGiftUsersView.m */, + E8788943273A55C200BF1D57 /* XPGiftInfoView.h */, + E8788944273A55C200BF1D57 /* XPGiftInfoView.m */, + E8788946273A55D000BF1D57 /* XPGiftBarView.h */, + E8788947273A55D000BF1D57 /* XPGiftBarView.m */, + ); + path = View; + sourceTree = ""; + }; + E8788938273A542E00BF1D57 /* Presenter */ = { + isa = PBXGroup; + children = ( + E878893D273A54F500BF1D57 /* XPGiftPresenter.h */, + E878893E273A54F500BF1D57 /* XPGiftPresenter.m */, + ); + path = Presenter; + sourceTree = ""; + }; + E8788939273A544000BF1D57 /* Protocol */ = { + isa = PBXGroup; + children = ( + E878894D273A672200BF1D57 /* XPGiftProtocol.h */, + ); + path = Protocol; + sourceTree = ""; + }; + E8788949273A594C00BF1D57 /* Cell */ = { + isa = PBXGroup; + children = ( + E878894A273A607C00BF1D57 /* XPGiftUserCollectionViewCell.h */, + E878894B273A607C00BF1D57 /* XPGiftUserCollectionViewCell.m */, + ); + path = Cell; + sourceTree = ""; + }; E88B5CA926FB15B900DA9178 /* Teenager */ = { isa = PBXGroup; children = ( @@ -2046,6 +2149,7 @@ 189DD76226E60DDC00AB55B1 /* Api+Login.m in Sources */, 18E7B22626E8CDCF0064BC9B /* XplanFlutterBoostDelegate.m in Sources */, E8EEB8F326FC2050007C6EBA /* SDWaitingView.m in Sources */, + E8788942273A55AD00BF1D57 /* XPGiftUsersView.m in Sources */, E8B846CB26FDD7CD00A777FE /* XPMineRechargeViewController.m in Sources */, E86596512701A1C000846EBD /* StatisticsService.m in Sources */, E824544026F58F9400BE8163 /* XPMinePayPwdViewController.m in Sources */, @@ -2063,12 +2167,14 @@ E84B0E3F2727EDF6008818C6 /* XPRoomMessageTableViewCell.m in Sources */, E8EEB8F226FC2050007C6EBA /* SDPhotoBrowser.m in Sources */, E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */, + E8788950273A699900BF1D57 /* ThemeColor+SendGift.m in Sources */, E81C279D26EEEC620031E639 /* XPConstant.m in Sources */, 187EEEFE26E8A82C002833B2 /* NSObject+AutoCoding.m in Sources */, E8AC721926F46E0B007D6E91 /* XPMineSettingItemModel.m in Sources */, 189DD55A26DE39D200AB55B1 /* BaseMvpPresenter.m in Sources */, 180806D827293794001FD836 /* NSObject+MJExtension.m in Sources */, 189DD6FF26E20E5900AB55B1 /* HttpRequestHelper.m in Sources */, + E8788945273A55C200BF1D57 /* XPGiftInfoView.m in Sources */, E8AEAED6271412EC0017FCE0 /* XPRoomViewController.m in Sources */, E8E70D9226F2F60C00F03460 /* XPMineItemModel.m in Sources */, 189DD74A26E21D8400AB55B1 /* SSKeychain.m in Sources */, @@ -2101,6 +2207,7 @@ E8EEB91726FC7B35007C6EBA /* XPMineUserInfoDesViewController.m in Sources */, 180806FB2729A354001FD836 /* ThemeColor+Room.m in Sources */, E8E70D8626F2F55C00F03460 /* XPMineAccountView.m in Sources */, + E878893C273A54C300BF1D57 /* Api+Gift.m in Sources */, E81C279026EB314D0031E639 /* LoginForgetEditView.m in Sources */, E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */, E81C27A026EEF83D0031E639 /* XPHtmlUrl.m in Sources */, @@ -2162,6 +2269,7 @@ 186A536926FC6F2E00D67B2C /* XCShareView.m in Sources */, 186A534C26FC6ED900D67B2C /* TTAlertView.m in Sources */, E8B825BF26E9E57D009E8E9F /* LoginTicketInfo.m in Sources */, + E878894C273A607C00BF1D57 /* XPGiftUserCollectionViewCell.m in Sources */, 181D7F212727D9DB00B7C059 /* SocialStageView.m in Sources */, 187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */, 186A536B26FC6F2E00D67B2C /* XCShareItemCell.m in Sources */, @@ -2175,6 +2283,7 @@ E824546426F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.m in Sources */, E8B846BC26FD7C1200A777FE /* UploadImage.m in Sources */, 186A534D26FC6ED900D67B2C /* TTActionSheetView.m in Sources */, + E878893F273A54F500BF1D57 /* XPGiftPresenter.m in Sources */, E8AEAEED27141AE20017FCE0 /* XPRoomBackContainerView.m in Sources */, E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */, E824545926F5E65900BE8163 /* XPMineVerifIdentityView.m in Sources */, @@ -2196,6 +2305,7 @@ 18E7B29026EA0E6B0064BC9B /* FlutterBoost+Xplan.m in Sources */, E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */, 189DD75926E6003C00AB55B1 /* Api.m in Sources */, + E8788934273A53D700BF1D57 /* XPSendGiftView.m in Sources */, E88B5CB826FB325200DA9178 /* XPMineTeenagerPwdPresenter.m in Sources */, E84B0E462727EF9D008818C6 /* XPRoomMessageParser.m in Sources */, E874B88827215D39003954B9 /* MicroStateModel.m in Sources */, @@ -2203,8 +2313,10 @@ E89DA66727006443008483C1 /* RechargeStorage.m in Sources */, 189DD53F26DE255600AB55B1 /* main.m in Sources */, E872308D26E89DAA00B90D4F /* LoginInputView.m in Sources */, + E8788948273A55D000BF1D57 /* XPGiftBarView.m in Sources */, 189DD58F26DF97E700AB55B1 /* LoginPresenter.m in Sources */, E89DA67227008D59008483C1 /* WalletInfoModel.m in Sources */, + E8788960273BB14200BF1D57 /* XPGiftMicroUserModel.m in Sources */, 189DD55026DE37F900AB55B1 /* MvpViewController.m in Sources */, E81366F326F0B7C80076364C /* LoginFullInfoViewController.m in Sources */, ); diff --git a/xplan-ios/Assets.xcassets/Gift/Contents.json b/xplan-ios/Assets.xcassets/Gift/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/Contents.json new file mode 100644 index 00000000..41ff831e --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_all_micro_normal@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_all_micro_normal@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/gift_all_micro_normal@2x.png b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/gift_all_micro_normal@2x.png new file mode 100644 index 00000000..0188186d Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/gift_all_micro_normal@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/gift_all_micro_normal@3x.png b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/gift_all_micro_normal@3x.png new file mode 100644 index 00000000..e55cbf77 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_normal.imageset/gift_all_micro_normal@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/Contents.json new file mode 100644 index 00000000..9752cff8 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_all_micro_select@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_all_micro_select@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/gift_all_micro_select@2x.png b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/gift_all_micro_select@2x.png new file mode 100644 index 00000000..d05970e1 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/gift_all_micro_select@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/gift_all_micro_select@3x.png b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/gift_all_micro_select@3x.png new file mode 100644 index 00000000..2fc39b68 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_all_micro_select.imageset/gift_all_micro_select@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/Contents.json new file mode 100644 index 00000000..6a8024e7 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_bar_count_arrow@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_bar_count_arrow@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/gift_bar_count_arrow@2x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/gift_bar_count_arrow@2x.png new file mode 100644 index 00000000..430d0f59 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/gift_bar_count_arrow@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/gift_bar_count_arrow@3x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/gift_bar_count_arrow@3x.png new file mode 100644 index 00000000..64ca49c5 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_arrow.imageset/gift_bar_count_arrow@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/Contents.json new file mode 100644 index 00000000..577e884c --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_bar_count_up_arrow@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_bar_count_up_arrow@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/gift_bar_count_up_arrow@2x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/gift_bar_count_up_arrow@2x.png new file mode 100644 index 00000000..61f2ef34 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/gift_bar_count_up_arrow@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/gift_bar_count_up_arrow@3x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/gift_bar_count_up_arrow@3x.png new file mode 100644 index 00000000..9977f725 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_count_up_arrow.imageset/gift_bar_count_up_arrow@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/Contents.json new file mode 100644 index 00000000..fc40b1b0 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_bar_recharge_arrow@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_bar_recharge_arrow@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/gift_bar_recharge_arrow@2x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/gift_bar_recharge_arrow@2x.png new file mode 100644 index 00000000..2a813a65 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/gift_bar_recharge_arrow@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/gift_bar_recharge_arrow@3x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/gift_bar_recharge_arrow@3x.png new file mode 100644 index 00000000..538d3c86 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_recharge_arrow.imageset/gift_bar_recharge_arrow@3x.png differ diff --git a/xplan-ios/Base/UI/SendGiftView/Api/Api+Gift.h b/xplan-ios/Base/UI/SendGiftView/Api/Api+Gift.h new file mode 100644 index 00000000..6f0c7a12 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/Api/Api+Gift.h @@ -0,0 +1,16 @@ +// +// Api+Gift.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "Api.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface Api (Gift) + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/Api/Api+Gift.m b/xplan-ios/Base/UI/SendGiftView/Api/Api+Gift.m new file mode 100644 index 00000000..00cbce1d --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/Api/Api+Gift.m @@ -0,0 +1,12 @@ +// +// Api+Gift.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "Api+Gift.h" + +@implementation Api (Gift) + +@end diff --git a/xplan-ios/Base/UI/SendGiftView/Model/XPGiftMicroUserModel.h b/xplan-ios/Base/UI/SendGiftView/Model/XPGiftMicroUserModel.h new file mode 100644 index 00000000..61ad1919 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/Model/XPGiftMicroUserModel.h @@ -0,0 +1,19 @@ +// +// XPGiftMicroUserModel.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/10. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class MicroQueueModel; +@interface XPGiftMicroUserModel : NSObject +///是否选择 本地字段刷新页面使用 +@property (nonatomic,assign) BOOL isSelect; +///麦序信息 +@property (nonatomic,strong) MicroQueueModel *microQueue; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/Model/XPGiftMicroUserModel.m b/xplan-ios/Base/UI/SendGiftView/Model/XPGiftMicroUserModel.m new file mode 100644 index 00000000..4ef44095 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/Model/XPGiftMicroUserModel.m @@ -0,0 +1,19 @@ +// +// XPGiftMicroUserModel.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/10. +// + +#import "XPGiftMicroUserModel.h" + +@implementation XPGiftMicroUserModel + +- (instancetype)init { + if (self = [super init]) { + self.isSelect = NO; + } + return self; +} + +@end diff --git a/xplan-ios/Base/UI/SendGiftView/Presenter/XPGiftPresenter.h b/xplan-ios/Base/UI/SendGiftView/Presenter/XPGiftPresenter.h new file mode 100644 index 00000000..50f06f67 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/Presenter/XPGiftPresenter.h @@ -0,0 +1,16 @@ +// +// XPGiftPresenter.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "BaseMvpPresenter.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPGiftPresenter : BaseMvpPresenter + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/Presenter/XPGiftPresenter.m b/xplan-ios/Base/UI/SendGiftView/Presenter/XPGiftPresenter.m new file mode 100644 index 00000000..f6eabf5c --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/Presenter/XPGiftPresenter.m @@ -0,0 +1,12 @@ +// +// XPGiftPresenter.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "XPGiftPresenter.h" + +@implementation XPGiftPresenter + +@end diff --git a/xplan-ios/Base/UI/SendGiftView/Protocol/XPGiftProtocol.h b/xplan-ios/Base/UI/SendGiftView/Protocol/XPGiftProtocol.h new file mode 100644 index 00000000..5febedf5 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/Protocol/XPGiftProtocol.h @@ -0,0 +1,16 @@ +// +// XPGiftProtocol.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol XPGiftProtocol + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/ThemeColor+SendGift.h b/xplan-ios/Base/UI/SendGiftView/ThemeColor+SendGift.h new file mode 100644 index 00000000..9361b6be --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/ThemeColor+SendGift.h @@ -0,0 +1,21 @@ +// +// ThemeColor+SendGift.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "ThemeColor.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface ThemeColor (SendGift) +/// 没有选择送礼物的人的头像 UIColorRGBAlpha(0x000000, 0.3) ++ (UIColor *)avatarCoverColor; +/// 送礼物 充值 0xFF903E ++ (UIColor *)giftRechargeColor; +/// 礼物主背景色 #0B0B0D ++ (UIColor *)giftBackGroundColor; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/ThemeColor+SendGift.m b/xplan-ios/Base/UI/SendGiftView/ThemeColor+SendGift.m new file mode 100644 index 00000000..2a68d5e5 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/ThemeColor+SendGift.m @@ -0,0 +1,27 @@ +// +// ThemeColor+SendGift.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "ThemeColor+SendGift.h" + +@implementation ThemeColor (SendGift) + +/// 没有选择送礼物的人的头像 UIColorRGBAlpha(0x000000, 0.3) ++ (UIColor *)avatarCoverColor { + return [UIColor colorWithWhite:0 alpha:0.3]; +} + +/// 送礼物 充值 0xFF903E ++ (UIColor *)giftRechargeColor { + return UIColorFromRGB(0xFF903E); +} + +/// 礼物主背景色 #0B0B0D ++ (UIColor *)giftBackGroundColor { + return UIColorRGBAlpha(0x0C0B0C, 0.9); +} + +@end diff --git a/xplan-ios/Base/UI/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.h b/xplan-ios/Base/UI/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.h new file mode 100644 index 00000000..3390c4f3 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.h @@ -0,0 +1,17 @@ +// +// XPGiftUserCollectionViewCell.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class XPGiftMicroUserModel; +@interface XPGiftUserCollectionViewCell : UICollectionViewCell +///数据模型 +@property (nonatomic,strong) XPGiftMicroUserModel *microModel; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m b/xplan-ios/Base/UI/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m new file mode 100644 index 00000000..ba3cb500 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m @@ -0,0 +1,120 @@ +// +// XPGiftUserCollectionViewCell.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "XPGiftUserCollectionViewCell.h" +///Third +#import +///Tool +#import "ThemeColor+SendGift.h" +///Model +#import "MicroQueueModel.h" +#import "UserInfoModel.h" +#import "MicroStateModel.h" +#import "XPGiftMicroUserModel.h" +///View +#import "NetImageView.h" + +@interface XPGiftUserCollectionViewCell () +///头像 +@property (nonatomic,strong) NetImageView *avatarImageView; +///当前位置的 +@property (nonatomic,strong) UILabel *positionLabel; +///没有选中的时候覆盖的 +@property (nonatomic,strong) UIView * coverView; +@end + +@implementation XPGiftUserCollectionViewCell + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + self.coverView.layer.cornerRadius = self.coverView.frame.size.width / 2; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self.contentView addSubview:self.avatarImageView]; + [self.contentView addSubview:self.positionLabel]; + [self.contentView addSubview:self.coverView]; +} + +- (void)initSubViewConstraints { + [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.mas_equalTo(self.contentView); + make.height.mas_equalTo(self.avatarImageView.mas_width); + }]; + + [self.positionLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(10); + make.centerY.mas_equalTo(self.avatarImageView.mas_bottom); + make.width.mas_equalTo(10); + }]; + + [self.coverView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.contentView); + }]; +} + +#pragma mark - Getters And Setters +- (void)setMicroModel:(XPGiftMicroUserModel *)microModel { + _microModel = microModel; + if (_microModel.microQueue.microState.position == -1) { + self.positionLabel.text = @"房主位"; + [self.positionLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(23); + }]; + } else { + self.positionLabel.text = [NSString stringWithFormat:@"%d", microModel.microQueue.microState.position]; + [self.positionLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(10); + }]; + } + UserInfoModel * userInfo = microModel.microQueue.userInfo; + self.avatarImageView.imageUrl = userInfo.avatar; + + self.coverView.hidden = microModel.isSelect; +} + +- (NetImageView *)avatarImageView { + if (!_avatarImageView) { + _avatarImageView = [[NetImageView alloc] init]; + _avatarImageView.layer.masksToBounds = YES; + _avatarImageView.layer.cornerRadius = 15; + _avatarImageView.imageType = ImageTypeUserIcon; + _avatarImageView.image = [UIImageConstant defaultAvatarPlaceholder]; + } + return _avatarImageView; +} + +- (UILabel *)positionLabel{ + if (!_positionLabel) { + _positionLabel = [[UILabel alloc] init]; + _positionLabel.font = [UIFont systemFontOfSize:14]; + _positionLabel.textColor = [ThemeColor mainTextColor]; + _positionLabel.textAlignment = NSTextAlignmentCenter; + } + return _positionLabel; +} + +- (UIView *)coverView { + if (!_coverView) { + _coverView = [[UIView alloc] init]; + _coverView.backgroundColor = [ThemeColor avatarCoverColor]; + _coverView.layer.masksToBounds = YES; + _coverView.layer.cornerRadius = 38/2; + } + return _coverView; +} + +@end diff --git a/xplan-ios/Base/UI/SendGiftView/View/XPGiftBarView.h b/xplan-ios/Base/UI/SendGiftView/View/XPGiftBarView.h new file mode 100644 index 00000000..0cbedfe5 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/XPGiftBarView.h @@ -0,0 +1,16 @@ +// +// XPGiftBottomView.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPGiftBarView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/View/XPGiftBarView.m b/xplan-ios/Base/UI/SendGiftView/View/XPGiftBarView.m new file mode 100644 index 00000000..e076e836 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/XPGiftBarView.m @@ -0,0 +1,200 @@ +// +// XPGiftBottomView.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "XPGiftBarView.h" +///Third +#import +///Tool +#import "ThemeColor+SendGift.h" +#import "UIImage+Utils.h" + +@interface XPGiftBarView () +///余额 +@property (nonatomic,strong) UILabel *balanceLabel; +/// +@property (nonatomic,strong) UIStackView *rechargeStackView; +///充值 +@property (nonatomic,strong) UILabel *rechargeLabel; +///去充值 +@property (nonatomic,strong) UIImageView *rechageImageView; +/// +@property (nonatomic,strong) UIView *sendOperationView; +///个数 +@property (nonatomic,strong) UILabel *countLabel; +///箭头 +@property (nonatomic,strong) UIButton *arrowButton; +///赠送 +@property (nonatomic,strong) UIButton *sendGiftButton; +@end + +@implementation XPGiftBarView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} +#pragma mark - Response +- (void)sendButtonAction:(UIButton *)sender { + +} + +- (void)rechargeButtonAction:(UIButton *)sender { + +} + +- (void)arrowButtonAction:(UIButton *)sender { + +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor= [UIColor clearColor]; + [self addSubview:self.balanceLabel]; + [self addSubview:self.rechargeStackView]; + [self addSubview:self.sendOperationView]; + + [self.rechargeStackView addArrangedSubview:self.rechargeLabel]; + [self.rechargeStackView addArrangedSubview:self.rechageImageView]; + + [self.sendOperationView addSubview:self.countLabel]; + [self.sendOperationView addSubview:self.arrowButton]; + [self.sendOperationView addSubview:self.sendGiftButton]; +} + +- (void)initSubViewConstraints { + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(45); + }]; + + [self.balanceLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(15); + make.centerY.mas_equalTo(self.sendOperationView); + }]; + + [self.rechargeStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.sendOperationView); + make.left.mas_equalTo(self.balanceLabel.mas_right).offset(12); + }]; + + [self.sendOperationView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(self).offset(-15); + make.bottom.mas_equalTo(-11); + make.height.mas_equalTo(30); + make.left.mas_equalTo(self.countLabel.mas_left).offset(-13); + }]; + + [self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.sendGiftButton); + make.right.mas_equalTo(self.arrowButton.mas_left).offset(-10); + }]; + + + [self.arrowButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(10, 10)); + make.centerY.mas_equalTo(self.sendGiftButton); + make.right.mas_equalTo(self.sendGiftButton.mas_left).offset(-10); + }]; + + [self.sendGiftButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(67, 30)); + make.right.centerY.mas_equalTo(self.sendOperationView); + }]; +} + +#pragma mark - Getters And Setters +- (UILabel *)balanceLabel { + if (!_balanceLabel) { + _balanceLabel = [[UILabel alloc] init]; + _balanceLabel.textColor = [ThemeColor mainTextColor]; + _balanceLabel.font = [UIFont systemFontOfSize:13]; + _balanceLabel.text = @"余额:10000"; + } + return _balanceLabel; +} + +- (UIStackView *)rechargeStackView { + if (!_rechargeStackView) { + _rechargeStackView = [[UIStackView alloc] init]; + _rechargeStackView.axis = UILayoutConstraintAxisHorizontal; + _rechargeStackView.distribution = UIStackViewDistributionFill; + _rechargeStackView.alignment = UIStackViewAlignmentCenter; + _rechargeStackView.spacing = 5; + } + return _rechargeStackView; +} + +- (UILabel *)rechargeLabel { + if (!_rechargeLabel) { + _rechargeLabel = [[UILabel alloc] init]; + _rechargeLabel.text = @"充值"; + _rechargeLabel.font = [UIFont systemFontOfSize:13]; + _rechargeLabel.textColor = [ThemeColor giftRechargeColor]; + } + return _rechargeLabel; +} + +- (UIImageView *)rechageImageView { + if (!_rechageImageView) { + _rechageImageView = [[UIImageView alloc] init]; + _rechageImageView.userInteractionEnabled = YES; + _rechageImageView.image = [UIImage imageNamed:@"gift_bar_recharge_arrow"]; + } + return _rechageImageView; +} + + +- (UIView *)sendOperationView { + if (!_sendOperationView) { + _sendOperationView = [[UIView alloc] init]; + _sendOperationView.layer.masksToBounds = YES; + _sendOperationView.layer.cornerRadius = 15; + _sendOperationView.layer.borderColor = [ThemeColor appMainColor].CGColor; + _sendOperationView.layer.borderWidth = 1; + } + return _sendOperationView; +} + +- (UILabel *)countLabel { + if (!_countLabel) { + _countLabel = [[UILabel alloc] init]; + _countLabel.textAlignment = NSTextAlignmentCenter; + _countLabel.textColor = [ThemeColor mainTextColor]; + _countLabel.text = @"1"; + _countLabel.font = [UIFont systemFontOfSize:13]; + } + return _countLabel; +} + +- (UIButton *)arrowButton { + if (!_arrowButton) { + _arrowButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_arrowButton setImage:[UIImage imageNamed:@"gift_bar_count_arrow"] forState:UIControlStateNormal]; + [_arrowButton setImage:[UIImage imageNamed:@"gift_bar_count_up_arrow"] forState:UIControlStateSelected]; + [_arrowButton addTarget:self action:@selector(arrowButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _arrowButton; +} + +- (UIButton *)sendGiftButton { + if (!_sendGiftButton) { + _sendGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_sendGiftButton setTitle:@"赠送" forState:UIControlStateNormal]; + [_sendGiftButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; + [_sendGiftButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; + _sendGiftButton.titleLabel.font = [UIFont systemFontOfSize:13]; + _sendGiftButton.layer.masksToBounds = YES; + _sendGiftButton.layer.cornerRadius = 15; + [_sendGiftButton addTarget:self action:@selector(sendButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _sendGiftButton; +} + +@end diff --git a/xplan-ios/Base/UI/SendGiftView/View/XPGiftInfoView.h b/xplan-ios/Base/UI/SendGiftView/View/XPGiftInfoView.h new file mode 100644 index 00000000..b134b1c1 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/XPGiftInfoView.h @@ -0,0 +1,16 @@ +// +// XPGiftMiddleView.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPGiftInfoView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/View/XPGiftInfoView.m b/xplan-ios/Base/UI/SendGiftView/View/XPGiftInfoView.m new file mode 100644 index 00000000..f81e1979 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/XPGiftInfoView.m @@ -0,0 +1,36 @@ +// +// XPGiftMiddleView.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "XPGiftInfoView.h" +///Third +#import + +@implementation XPGiftInfoView + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor yellowColor]; +} + +- (void)initSubViewConstraints { + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(250); + }]; +} + +@end diff --git a/xplan-ios/Base/UI/SendGiftView/View/XPGiftUsersView.h b/xplan-ios/Base/UI/SendGiftView/View/XPGiftUsersView.h new file mode 100644 index 00000000..938c2349 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/XPGiftUsersView.h @@ -0,0 +1,20 @@ +// +// XPGiftUsersView.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import +#import "XPSendGiftView.h" +#import "MicroQueueProtocol.h" +NS_ASSUME_NONNULL_BEGIN + +@interface XPGiftUsersView : UIView + +- (instancetype)initWithType:(SendGiftType)type; +///选中的人 送给谁礼物 +@property (nonatomic,strong, readonly) NSMutableArray *selectUserArray; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/View/XPGiftUsersView.m b/xplan-ios/Base/UI/SendGiftView/View/XPGiftUsersView.m new file mode 100644 index 00000000..4e4b9196 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/XPGiftUsersView.m @@ -0,0 +1,169 @@ +// +// XPGiftUsersView.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "XPGiftUsersView.h" +///Third +#import +///Tool +#import "AccountInfoStorage.h" +///Model +#import "UserInfoModel.h" +#import "MicroQueueModel.h" +#import "XPGiftMicroUserModel.h" +///view +#import "XPGiftUserCollectionViewCell.h" +@interface XPGiftUsersView () +/// +@property (nonatomic,strong) UIStackView *stackView; +///全麦 +@property (nonatomic,strong) UIButton *allMicroButton; +///列表 +@property (nonatomic,strong) UICollectionView *collectionView; +///送礼物的类型 +@property (nonatomic,assign) SendGiftType type; +/// +@property (nonatomic,strong) NSArray *userArray; +///选中的人 +@property (nonatomic,strong) NSMutableArray *selectUserArray; +@end + +@implementation XPGiftUsersView + +- (instancetype)initWithType:(SendGiftType)type { + if (self = [super init]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} +#pragma mark - Response +- (void)allMicroButtonAction:(UIButton *)sender { + sender.selected = !sender.selected; + [self.userArray enumerateObjectsUsingBlock:^(XPGiftMicroUserModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + obj.isSelect = YES; + }]; + [self.collectionView reloadData]; +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor purpleColor]; + [self addSubview:self.stackView]; + [self.stackView addArrangedSubview:self.allMicroButton]; + [self.stackView addArrangedSubview:self.collectionView]; + if (self.type == SendGiftType_User) { + self.allMicroButton.hidden = YES; + } +} + +- (void)initSubViewConstraints { + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(28 + 15 * 2); + }]; + + [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self); + }]; +} + +/// 查找麦序 坑位上有人的麦序 +/// @param users 麦序列表 +- (NSArray *)findSendGiftAllUsers:(NSArray *)users { + NSMutableArray * tempArray = [NSMutableArray array]; + NSString * uid = [AccountInfoStorage instance].getUid; + for (int i = 0; i < users.count; i++) { + MicroQueueModel * micModel = [users objectAtIndex:i]; + UserInfoModel * userInfo = micModel.userInfo; + if (userInfo && userInfo.uid > 0 && userInfo.uid != uid.integerValue) { ///自己在麦上不显示在送礼物列表中 + XPGiftMicroUserModel * giftUserModel = [[XPGiftMicroUserModel alloc] init]; + if ([self.selectUserArray containsObject:[NSString stringWithFormat:@"%ld", userInfo.uid]]){ + giftUserModel.isSelect = YES; + } + [tempArray addObject:giftUserModel]; + } + } + return [tempArray copy]; +} + +#pragma mark - MicroQueueProtocol +- (void)onMicroQueueUpdate:(NSMutableDictionary *)queue { + self.userArray = [self findSendGiftAllUsers:queue.allValues]; + [self.collectionView reloadData]; +} + +#pragma mark - UICollectionViewDataSource And UICollectionViewDelegate +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.userArray.count; +} + +-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + XPGiftUserCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPGiftUserCollectionViewCell class]) forIndexPath:indexPath]; + XPGiftMicroUserModel * queue = [self.userArray objectAtIndex:indexPath.row]; + cell.microModel = queue; + return cell; +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + [collectionView deselectItemAtIndexPath:indexPath animated:YES]; + XPGiftMicroUserModel * queue = [self.userArray objectAtIndex:indexPath.row]; + queue.isSelect = !queue.isSelect; + [self.collectionView reloadData]; + NSString * selectUid = [NSString stringWithFormat:@"%ld", queue.microQueue.userInfo.uid]; + if (queue.isSelect) { + [self.selectUserArray addObject:selectUid]; + } else { + if ([self.selectUserArray containsObject:selectUid]) { + [self.selectUserArray removeObject:selectUid]; + } + } +} +#pragma mark - Getters And Setters +- (UIStackView *)stackView { + if (!_stackView) { + _stackView = [[UIStackView alloc] init]; + _stackView.axis = UILayoutConstraintAxisHorizontal; + _stackView.distribution = UIStackViewDistributionFill; + _stackView.alignment = UIStackViewAlignmentCenter; + _stackView.spacing = 10; + } + return _stackView; +} + +- (UIButton *)allMicroButton { + if (!_allMicroButton) { + _allMicroButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_allMicroButton setImage:[UIImage imageNamed:@"gift_all_micro_normal"] forState:UIControlStateNormal]; + [_allMicroButton setImage:[UIImage imageNamed:@"gift_all_micro_select"] forState:UIControlStateSelected]; + [_allMicroButton addTarget:self action:@selector(allMicroButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _allMicroButton; +} + +- (UICollectionView *)collectionView{ + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.itemSize = CGSizeMake(28, 35); + layout.minimumLineSpacing = 6; + layout.sectionInset = UIEdgeInsetsMake(0, 0, 0,0); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.dataSource = self; + _collectionView.delegate = self; + _collectionView.backgroundColor = [UIColor clearColor]; + _collectionView.showsHorizontalScrollIndicator = NO; + [_collectionView registerClass:[XPGiftUserCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPGiftUserCollectionViewCell class])]; + } + return _collectionView; +} + +- (NSMutableArray *)selectUserArray { + if (!_selectUserArray) { + _selectUserArray = [NSMutableArray array]; + } + return _selectUserArray; +} + +@end diff --git a/xplan-ios/Base/UI/SendGiftView/View/XPSendGiftView.h b/xplan-ios/Base/UI/SendGiftView/View/XPSendGiftView.h new file mode 100644 index 00000000..2606cd8f --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/XPSendGiftView.h @@ -0,0 +1,31 @@ +// +// XPSendGiftView.h +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +typedef NS_ENUM(NSInteger, SendGiftType) { + SendGiftType_Room = 1, ///房间内送礼物 + SendGiftType_User, ///送给某一个人 +}; + + +@interface XPSendGiftView : UIView + +/// 送礼物的 +/// @param type 送礼物的类型 +/// @param uid 送礼物的人 +- (instancetype)initWithType:(SendGiftType)type uid:(NSString *)uid; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)copy NS_UNAVAILABLE; +- (instancetype)mutableCopy NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/UI/SendGiftView/View/XPSendGiftView.m b/xplan-ios/Base/UI/SendGiftView/View/XPSendGiftView.m new file mode 100644 index 00000000..31bb32d4 --- /dev/null +++ b/xplan-ios/Base/UI/SendGiftView/View/XPSendGiftView.m @@ -0,0 +1,96 @@ +// +// XPSendGiftView.m +// xplan-ios +// +// Created by 冯硕 on 2021/11/9. +// + +#import "XPSendGiftView.h" +///Third +#import +///Tool +#import "XPMacro.h" +#import "ThemeColor+SendGift.h" +///View +#import "XPGiftUsersView.h" +#import "XPGiftInfoView.h" +#import "XPGiftBarView.h" + + +@interface XPSendGiftView () +/// +@property (nonatomic,strong) UIStackView *stackView; +///送礼物的人 +@property (nonatomic,strong) XPGiftUsersView *userView; +///送的什么礼物 +@property (nonatomic,strong) XPGiftInfoView *giftInfoView; +///送多少礼物 +@property (nonatomic,strong) XPGiftBarView *giftBarView; + +@end + +@implementation XPSendGiftView + +- (instancetype)initWithType:(SendGiftType)type uid:(NSString *)uid { + if (self = [super init]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [ThemeColor giftBackGroundColor]; + [self addSubview:self.stackView]; + [self.stackView addArrangedSubview:self.userView]; + [self.stackView addArrangedSubview:self.giftInfoView]; + [self.stackView addArrangedSubview:self.giftBarView]; +} + +- (void)initSubViewConstraints { + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(KScreenWidth); + make.bottom.mas_equalTo(self.stackView.mas_bottom); + }]; + + [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.mas_equalTo(self); + }]; +} + +#pragma mark - Getters And Setters +- (XPGiftUsersView *)userView { + if (!_userView) { + _userView = [[XPGiftUsersView alloc] initWithType:SendGiftType_Room]; + } + return _userView; +} + +- (XPGiftInfoView *)giftInfoView { + if (!_giftInfoView) { + _giftInfoView = [[XPGiftInfoView alloc] init]; + } + return _giftInfoView; +} + +- (XPGiftBarView *)giftBarView { + if (!_giftBarView) { + _giftBarView = [[XPGiftBarView alloc] init]; + } + return _giftBarView; +} + +- (UIStackView *)stackView { + if (!_stackView) { + _stackView = [[UIStackView alloc] init]; + _stackView.axis = UILayoutConstraintAxisVertical; + _stackView.distribution = UIStackViewDistributionFill; + _stackView.alignment = UIStackViewAlignmentFill; + _stackView.spacing = 0; + _stackView.backgroundColor = [UIColor clearColor]; + } + return _stackView; +} + +@end diff --git a/xplan-ios/Base/UI/ThemeColor.h b/xplan-ios/Base/UI/ThemeColor.h index ba565051..4373455d 100644 --- a/xplan-ios/Base/UI/ThemeColor.h +++ b/xplan-ios/Base/UI/ThemeColor.h @@ -9,6 +9,7 @@ #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] +#define UIColorRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)] NS_ASSUME_NONNULL_BEGIN @interface ThemeColor : NSObject diff --git a/xplan-ios/Main/Room/View/MenuContainerView/XPRoomMenuContainerView.m b/xplan-ios/Main/Room/View/MenuContainerView/XPRoomMenuContainerView.m index be4aca1e..e8bc4f35 100644 --- a/xplan-ios/Main/Room/View/MenuContainerView/XPRoomMenuContainerView.m +++ b/xplan-ios/Main/Room/View/MenuContainerView/XPRoomMenuContainerView.m @@ -10,13 +10,16 @@ #import ///Tool #import "AccountInfoStorage.h" +#import "TTPopup.h" ///Model #import "XPRoomMenuItem.h" #import "MicroQueueModel.h" #import "UserInfoModel.h" #import "MicroStateModel.h" +#import "RoomInfoModel.h" ///View #import "XPRoomSendTextView.h" +#import "XPSendGiftView.h" #import "RtcManager.h" @@ -75,6 +78,12 @@ self.voiceButton.selected = [RtcManager instance].isRemoteMuted; } break; + case XPRoomMenuItemType_Gift: { + NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid]; + XPSendGiftView * giftView = [[XPSendGiftView alloc] initWithType:SendGiftType_Room uid:roomUid]; + [TTPopup popupView:giftView style:TTPopupStyleActionSheet]; + } + break; default: break; @@ -214,7 +223,6 @@ [_giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateSelected]; _giftButton.tag = XPRoomMenuItemType_Gift; [_giftButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - _giftButton.hidden = YES; } return _giftButton; }