diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index c718a8e2..5065b1ee 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -131,6 +131,10 @@ 18F404BB2760982000A6C548 /* ChatLimitModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F404BA2760982000A6C548 /* ChatLimitModel.m */; }; 18F404C3276098F100A6C548 /* Api+Message.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F404C2276098F100A6C548 /* Api+Message.m */; }; 18F404C927609A4300A6C548 /* MessagePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F404C827609A4300A6C548 /* MessagePresenter.m */; }; + 230017E72B6357F70034A86C /* MewUnlockGiftBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = 230017E62B6357F70034A86C /* MewUnlockGiftBroadcastView.m */; }; + 230017EA2B635A790034A86C /* MewUnlockGiftBroadcastViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 230017E92B635A790034A86C /* MewUnlockGiftBroadcastViewCell.m */; }; + 230017ED2B639C8D0034A86C /* MewUnlockGiftModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 230017EC2B639C8D0034A86C /* MewUnlockGiftModel.m */; }; + 230017F02B639E730034A86C /* MewUnlockBaseGiftModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 230017EF2B639E730034A86C /* MewUnlockBaseGiftModel.m */; }; 230496ED2A6E1EE0006D1F0C /* XPPrivilegeCardVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 230496EC2A6E1EE0006D1F0C /* XPPrivilegeCardVC.m */; }; 230496F02A6E1F1F006D1F0C /* XPPrivilegeCardPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 230496EF2A6E1F1F006D1F0C /* XPPrivilegeCardPresenter.m */; }; 230496F32A6E229B006D1F0C /* XPPrivilegeCardItemVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 230496F22A6E229B006D1F0C /* XPPrivilegeCardItemVC.m */; }; @@ -184,6 +188,8 @@ 231EBB5D2B358C4C006F782E /* MewMainHomeGameTabModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 231EBB5C2B358C4C006F782E /* MewMainHomeGameTabModel.m */; }; 232153DD2AF381E400B2FBC0 /* MovEncodeToMpegTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 232153DC2AF381E400B2FBC0 /* MovEncodeToMpegTool.m */; }; 232153E02AF394BF00B2FBC0 /* XPPrivilegeCardVideoItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 232153DF2AF394BF00B2FBC0 /* XPPrivilegeCardVideoItemModel.m */; }; + 23494A012B68DA4B00655D8A /* XPMineDataSkillCardCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23494A002B68DA4B00655D8A /* XPMineDataSkillCardCollectionViewCell.m */; }; + 23494A042B68DCBC00655D8A /* XPMineDataGiftHeadCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23494A032B68DCBC00655D8A /* XPMineDataGiftHeadCell.m */; }; 236FF06C2AF8892400BEB6EC /* XPClientH5UresModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 236FF06B2AF8892400BEB6EC /* XPClientH5UresModel.m */; }; 237B89DC2A931479005DB380 /* XPMineUserGameVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B89DB2A931479005DB380 /* XPMineUserGameVC.m */; }; 237B89DF2A933F52005DB380 /* XPMineUserGameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 237B89DE2A933F52005DB380 /* XPMineUserGameCell.m */; }; @@ -1650,6 +1656,14 @@ 18F404C6276099DF00A6C548 /* MessageProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageProtocol.h; sourceTree = ""; }; 18F404C727609A4300A6C548 /* MessagePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessagePresenter.h; sourceTree = ""; }; 18F404C827609A4300A6C548 /* MessagePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessagePresenter.m; sourceTree = ""; }; + 230017E52B6357F70034A86C /* MewUnlockGiftBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewUnlockGiftBroadcastView.h; sourceTree = ""; }; + 230017E62B6357F70034A86C /* MewUnlockGiftBroadcastView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewUnlockGiftBroadcastView.m; sourceTree = ""; }; + 230017E82B635A790034A86C /* MewUnlockGiftBroadcastViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewUnlockGiftBroadcastViewCell.h; sourceTree = ""; }; + 230017E92B635A790034A86C /* MewUnlockGiftBroadcastViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewUnlockGiftBroadcastViewCell.m; sourceTree = ""; }; + 230017EB2B639C8D0034A86C /* MewUnlockGiftModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewUnlockGiftModel.h; sourceTree = ""; }; + 230017EC2B639C8D0034A86C /* MewUnlockGiftModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewUnlockGiftModel.m; sourceTree = ""; }; + 230017EE2B639E730034A86C /* MewUnlockBaseGiftModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewUnlockBaseGiftModel.h; sourceTree = ""; }; + 230017EF2B639E730034A86C /* MewUnlockBaseGiftModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewUnlockBaseGiftModel.m; sourceTree = ""; }; 230496EB2A6E1EE0006D1F0C /* XPPrivilegeCardVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPrivilegeCardVC.h; sourceTree = ""; }; 230496EC2A6E1EE0006D1F0C /* XPPrivilegeCardVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPrivilegeCardVC.m; sourceTree = ""; }; 230496EE2A6E1F1F006D1F0C /* XPPrivilegeCardPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPrivilegeCardPresenter.h; sourceTree = ""; }; @@ -1751,6 +1765,10 @@ 232153DC2AF381E400B2FBC0 /* MovEncodeToMpegTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MovEncodeToMpegTool.m; sourceTree = ""; }; 232153DE2AF394BF00B2FBC0 /* XPPrivilegeCardVideoItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPrivilegeCardVideoItemModel.h; sourceTree = ""; }; 232153DF2AF394BF00B2FBC0 /* XPPrivilegeCardVideoItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPrivilegeCardVideoItemModel.m; sourceTree = ""; }; + 234949FF2B68DA4B00655D8A /* XPMineDataSkillCardCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineDataSkillCardCollectionViewCell.h; sourceTree = ""; }; + 23494A002B68DA4B00655D8A /* XPMineDataSkillCardCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineDataSkillCardCollectionViewCell.m; sourceTree = ""; }; + 23494A022B68DCBC00655D8A /* XPMineDataGiftHeadCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineDataGiftHeadCell.h; sourceTree = ""; }; + 23494A032B68DCBC00655D8A /* XPMineDataGiftHeadCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineDataGiftHeadCell.m; sourceTree = ""; }; 236FF06A2AF8892400BEB6EC /* XPClientH5UresModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPClientH5UresModel.h; sourceTree = ""; }; 236FF06B2AF8892400BEB6EC /* XPClientH5UresModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPClientH5UresModel.m; sourceTree = ""; }; 237B89DA2A931479005DB380 /* XPMineUserGameVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserGameVC.h; sourceTree = ""; }; @@ -7760,6 +7778,10 @@ E8A3538428FD67320014A784 /* GiftLuckyBroadcastModel.m */, E8D4DE452940473500EC788D /* GiftTwelveStarFirstModel.h */, E8D4DE462940473500EC788D /* GiftTwelveStarFirstModel.m */, + 230017EB2B639C8D0034A86C /* MewUnlockGiftModel.h */, + 230017EC2B639C8D0034A86C /* MewUnlockGiftModel.m */, + 230017EE2B639E730034A86C /* MewUnlockBaseGiftModel.h */, + 230017EF2B639E730034A86C /* MewUnlockBaseGiftModel.m */, ); path = Model; sourceTree = ""; @@ -7793,6 +7815,10 @@ E8901CF528B38D89001E9A92 /* XPGraffitiGiftView.m */, 9B4D449128F15765002572D5 /* XPGiftLuckyGiftBroadcastView.h */, 9B4D449228F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m */, + 230017E52B6357F70034A86C /* MewUnlockGiftBroadcastView.h */, + 230017E62B6357F70034A86C /* MewUnlockGiftBroadcastView.m */, + 230017E82B635A790034A86C /* MewUnlockGiftBroadcastViewCell.h */, + 230017E92B635A790034A86C /* MewUnlockGiftBroadcastViewCell.m */, 9B4D449428F15EE7002572D5 /* XPGiftWeekStarBroadcastView.h */, 9B4D449528F15EE7002572D5 /* XPGiftWeekStarBroadcastView.m */, E8D4DE422940462C00EC788D /* XPGiftTwelveStarBroadcastView.h */, @@ -9994,12 +10020,16 @@ E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */, E8D34D4828080335009C4835 /* XPMineDataSkillCardTableViewCell.h */, E8D34D4928080335009C4835 /* XPMineDataSkillCardTableViewCell.m */, + 234949FF2B68DA4B00655D8A /* XPMineDataSkillCardCollectionViewCell.h */, + 23494A002B68DA4B00655D8A /* XPMineDataSkillCardCollectionViewCell.m */, E8D34D512808037E009C4835 /* XPMineDataSkillDataCollectionViewCell.h */, E8D34D522808037E009C4835 /* XPMineDataSkillDataCollectionViewCell.m */, E8D34D4B28080351009C4835 /* XPMineDataClanTableViewCell.h */, E8D34D4C28080351009C4835 /* XPMineDataClanTableViewCell.m */, E8D34D4E28080362009C4835 /* XPMineDataGiftTableViewCell.h */, E8D34D4F28080362009C4835 /* XPMineDataGiftTableViewCell.m */, + 23494A022B68DCBC00655D8A /* XPMineDataGiftHeadCell.h */, + 23494A032B68DCBC00655D8A /* XPMineDataGiftHeadCell.m */, E8D34D5428080393009C4835 /* XPMineDataGiftCollectionViewCell.h */, E8D34D5528080393009C4835 /* XPMineDataGiftCollectionViewCell.m */, E8D34D6528084E88009C4835 /* XPMineUserInfoGiftWallCollectionViewCell.h */, @@ -10404,6 +10434,7 @@ E8E0DAE0285C20E500566A2F /* MessageContentFindNewGreetView.m in Sources */, E8A3540128FEAC5E0014A784 /* XPWishGiftTableViewCell.m in Sources */, E8A86E0427BA38DB001C21F9 /* SudCommon.m in Sources */, + 230017ED2B639C8D0034A86C /* MewUnlockGiftModel.m in Sources */, E8EEB90326FC31DC007C6EBA /* XPMineUserInfoProtocol.h in Sources */, E8232603274E4AA0003A3332 /* ThemeColor+UserCard.m in Sources */, E8E859C228264C2300EE4857 /* HTTPErrorResponse.m in Sources */, @@ -10429,6 +10460,7 @@ E824545E26F5EF2200BE8163 /* XPMineVerifIdentityProtocol.h in Sources */, E824545326F5CEAD00BE8163 /* XPMineModifPayProtocol.h in Sources */, E84BF7D7277C6E2100EF8877 /* XPRoomRoleViewController.m in Sources */, + 230017E72B6357F70034A86C /* MewUnlockGiftBroadcastView.m in Sources */, E8AB631328ADDCF20023B0D2 /* XPMonentsTopicHeaderView.m in Sources */, 9B86D886281942D200494FCD /* SocialMicroView.m in Sources */, E8664ED027E42238000171BA /* XPRoomPKTimePickerView.m in Sources */, @@ -10550,6 +10582,7 @@ 9BEE3D0E27853BD000C83219 /* ThemeColor+NobleCenter.m in Sources */, 231EBB1A2B329B10006F782E /* MewHomeManager.m in Sources */, E8998D7A2859784200C68558 /* XPSVGAPlayer.m in Sources */, + 23494A012B68DA4B00655D8A /* XPMineDataSkillCardCollectionViewCell.m in Sources */, 9BD9A18427A0F128004186FE /* XPMineVisitorItemModel.m in Sources */, E852D73E28631C18001465ED /* XPMonentsCommentTableViewCell.m in Sources */, E80B0712280D0A6700A79F63 /* FansInfoModel.m in Sources */, @@ -10998,6 +11031,7 @@ E8DAC5AC2858305A00012CFD /* XPRoomMessageBubbleView.m in Sources */, E8A6C29F27CF5FE500AC7442 /* HomeLiveRoomModel.m in Sources */, E8B9843028AB90200022D026 /* XPMoentsTopicListView.m in Sources */, + 230017EA2B635A790034A86C /* MewUnlockGiftBroadcastViewCell.m in Sources */, E84150B827747B8B00A7F548 /* XPFirstRechargeViewController.m in Sources */, 9BBC02872786D75C0007C24B /* XPNobleUpgradeLevelView.m in Sources */, E8E20BDE28164D3A0033B688 /* SessionNavView.m in Sources */, @@ -11387,6 +11421,7 @@ E84150BF27747BD300A7F548 /* Api+FirstRecharge.m in Sources */, E8E859CF28264C2300EE4857 /* DDNumber.m in Sources */, E84B0E422727EE0A008818C6 /* XPRoomMessageHeaderView.m in Sources */, + 23494A042B68DCBC00655D8A /* XPMineDataGiftHeadCell.m in Sources */, E8C6FFDD2754CF5D004DC9F0 /* HomeRecommendRoomModel.m in Sources */, E852D73B286317F0001465ED /* XPMonentsDetailViewController.m in Sources */, 14C1F15729B874FB000A960F /* XPMineMoreItemTableViewCell.m in Sources */, @@ -11405,6 +11440,7 @@ E887531929BB26680017A41A /* CandyTreeMoreItemModel.m in Sources */, E8E859C628264C2300EE4857 /* HTTPAsyncFileResponse.m in Sources */, E845D16F283354A300BE21F7 /* XPEnterpriseTarotPayView.m in Sources */, + 230017F02B639E730034A86C /* MewUnlockBaseGiftModel.m in Sources */, E877A7EB2783E24700EFACED /* DatingStageView.m in Sources */, 9BD2ECDA288F867000F5CD9A /* XPMineFootPrintTableViewCell.m in Sources */, E8001635280410BD00D6D17A /* XPGuildIncomeSectionView.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Common/common_new_user.imageset/common_new_user@2x.png b/xplan-ios/Assets.xcassets/Common/common_new_user.imageset/common_new_user@2x.png index c028d489..5073a3e7 100644 Binary files a/xplan-ios/Assets.xcassets/Common/common_new_user.imageset/common_new_user@2x.png and b/xplan-ios/Assets.xcassets/Common/common_new_user.imageset/common_new_user@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Common/common_new_user.imageset/common_new_user@3x.png b/xplan-ios/Assets.xcassets/Common/common_new_user.imageset/common_new_user@3x.png index a6a9168a..8b8a5a8b 100644 Binary files a/xplan-ios/Assets.xcassets/Common/common_new_user.imageset/common_new_user@3x.png and b/xplan-ios/Assets.xcassets/Common/common_new_user.imageset/common_new_user@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/Contents.json new file mode 100644 index 00000000..91c7777a --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_infi_gift_bg1@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_infi_gift_bg1@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/mine_user_infi_gift_bg1@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/mine_user_infi_gift_bg1@2x.png new file mode 100644 index 00000000..656ff601 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/mine_user_infi_gift_bg1@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/mine_user_infi_gift_bg1@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/mine_user_infi_gift_bg1@3x.png new file mode 100644 index 00000000..13820f8c Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg1.imageset/mine_user_infi_gift_bg1@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/Contents.json new file mode 100644 index 00000000..5ce033fb --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_infi_gift_bg2@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_infi_gift_bg2@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/mine_user_infi_gift_bg2@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/mine_user_infi_gift_bg2@2x.png new file mode 100644 index 00000000..5f081ff4 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/mine_user_infi_gift_bg2@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/mine_user_infi_gift_bg2@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/mine_user_infi_gift_bg2@3x.png new file mode 100644 index 00000000..849c60f2 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg2.imageset/mine_user_infi_gift_bg2@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/Contents.json new file mode 100644 index 00000000..986ecc61 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_infi_gift_bg3@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_infi_gift_bg3@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/mine_user_infi_gift_bg3@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/mine_user_infi_gift_bg3@2x.png new file mode 100644 index 00000000..aed8aefe Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/mine_user_infi_gift_bg3@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/mine_user_infi_gift_bg3@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/mine_user_infi_gift_bg3@3x.png new file mode 100644 index 00000000..51adfa85 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg3.imageset/mine_user_infi_gift_bg3@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/Contents.json new file mode 100644 index 00000000..06100587 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_infi_gift_bg4@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_infi_gift_bg4@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/mine_user_infi_gift_bg4@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/mine_user_infi_gift_bg4@2x.png new file mode 100644 index 00000000..09c60c5c Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/mine_user_infi_gift_bg4@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/mine_user_infi_gift_bg4@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/mine_user_infi_gift_bg4@3x.png new file mode 100644 index 00000000..ea45f105 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg4.imageset/mine_user_infi_gift_bg4@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/Contents.json new file mode 100644 index 00000000..5dd146f2 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_infi_gift_bg5@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_infi_gift_bg5@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/mine_user_infi_gift_bg5@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/mine_user_infi_gift_bg5@2x.png new file mode 100644 index 00000000..b10bb5fd Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/mine_user_infi_gift_bg5@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/mine_user_infi_gift_bg5@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/mine_user_infi_gift_bg5@3x.png new file mode 100644 index 00000000..b8ee4363 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg5.imageset/mine_user_infi_gift_bg5@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/Contents.json new file mode 100644 index 00000000..ecb88962 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_infi_gift_bg6@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_infi_gift_bg6@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/mine_user_infi_gift_bg6@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/mine_user_infi_gift_bg6@2x.png new file mode 100644 index 00000000..bd1ed747 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/mine_user_infi_gift_bg6@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/mine_user_infi_gift_bg6@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/mine_user_infi_gift_bg6@3x.png new file mode 100644 index 00000000..b4beb4d0 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg6.imageset/mine_user_infi_gift_bg6@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/Contents.json new file mode 100644 index 00000000..07d7780e --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_infi_gift_bg7@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_infi_gift_bg7@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/mine_user_infi_gift_bg7@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/mine_user_infi_gift_bg7@2x.png new file mode 100644 index 00000000..c49119fa Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/mine_user_infi_gift_bg7@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/mine_user_infi_gift_bg7@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/mine_user_infi_gift_bg7@3x.png new file mode 100644 index 00000000..54e69d89 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg7.imageset/mine_user_infi_gift_bg7@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/Contents.json new file mode 100644 index 00000000..76e02c2c --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_infi_gift_bg8@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_infi_gift_bg8@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/mine_user_infi_gift_bg8@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/mine_user_infi_gift_bg8@2x.png new file mode 100644 index 00000000..868dfb75 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/mine_user_infi_gift_bg8@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/mine_user_infi_gift_bg8@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/mine_user_infi_gift_bg8@3x.png new file mode 100644 index 00000000..30692de0 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_infi_gift_bg8.imageset/mine_user_infi_gift_bg8@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/Contents.json b/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/Contents.json new file mode 100644 index 00000000..e02f6b93 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_user_info_gift_tip_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_user_info_gift_tip_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/mine_user_info_gift_tip_icon@2x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/mine_user_info_gift_tip_icon@2x.png new file mode 100644 index 00000000..6b453c58 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/mine_user_info_gift_tip_icon@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/mine_user_info_gift_tip_icon@3x.png b/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/mine_user_info_gift_tip_icon@3x.png new file mode 100644 index 00000000..8792a1ee Binary files /dev/null and b/xplan-ios/Assets.xcassets/Mine/mine_user_info_gift_tip_icon.imageset/mine_user_info_gift_tip_icon@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Room/room_gift_noble_lock.imageset/room_gift_noble_lock@2x.png b/xplan-ios/Assets.xcassets/Room/room_gift_noble_lock.imageset/room_gift_noble_lock@2x.png index 35a4ad4f..2febc144 100644 Binary files a/xplan-ios/Assets.xcassets/Room/room_gift_noble_lock.imageset/room_gift_noble_lock@2x.png and b/xplan-ios/Assets.xcassets/Room/room_gift_noble_lock.imageset/room_gift_noble_lock@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Room/room_gift_noble_lock.imageset/room_gift_noble_lock@3x.png b/xplan-ios/Assets.xcassets/Room/room_gift_noble_lock.imageset/room_gift_noble_lock@3x.png index 608b445d..61027c47 100644 Binary files a/xplan-ios/Assets.xcassets/Room/room_gift_noble_lock.imageset/room_gift_noble_lock@3x.png and b/xplan-ios/Assets.xcassets/Room/room_gift_noble_lock.imageset/room_gift_noble_lock@3x.png differ diff --git a/xplan-ios/Base/MVP/Presenter/BaseMvpPresenter.m b/xplan-ios/Base/MVP/Presenter/BaseMvpPresenter.m index e7d7e708..880f891b 100644 --- a/xplan-ios/Base/MVP/Presenter/BaseMvpPresenter.m +++ b/xplan-ios/Base/MVP/Presenter/BaseMvpPresenter.m @@ -109,14 +109,14 @@ break; case 10111: // 提现时,金额过大,需要先实名认证 [self.view hideHUD]; - [[self getView] showRealNameAuthenticationTipsAlertView]; + [[self getView] showRealNameAuthenticationTipsAlertView:@"为了营造更安全的网络环境\n保护您和他人的财产安全\n请先进行实名认证" isShowRoom:NO]; if (fail) { fail(code, msg); } return; case 10108: // 未实名认证 [self.view hideHUD]; - [[self getView] showRealNameAuthenticationTipsAlertView]; + [[self getView] showRealNameAuthenticationTipsAlertView:@"为了营造更安全的网络环境\n保护您和他人的财产安全\n请先进行实名认证" isShowRoom:NO]; if (fail) { fail(code, msg); } diff --git a/xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h b/xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h index e5853db7..0d386b1d 100644 --- a/xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h +++ b/xplan-ios/Base/MVP/Protocol/BaseMvpProtocol.h @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)accountCanceled:(NSDictionary *)data; ///实名认证弹窗 -- (void)showRealNameAuthenticationTipsAlertView; +- (void)showRealNameAuthenticationTipsAlertView:(NSString *)text isShowRoom:(BOOL)isShowRoom; ///封禁账号 - (void)accountBanned:(BaseModel *)data; diff --git a/xplan-ios/Base/MVP/View/MvpViewController.h b/xplan-ios/Base/MVP/View/MvpViewController.h index 6335e5ce..4c439b3d 100644 --- a/xplan-ios/Base/MVP/View/MvpViewController.h +++ b/xplan-ios/Base/MVP/View/MvpViewController.h @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN - (__kindof T)createPresenter; ///实名认证弹窗 -- (void)showRealNameAuthenticationTipsAlertView; +- (void)showRealNameAuthenticationTipsAlertView:(NSString *)text isShowRoom:(BOOL)isShowRoom; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/MVP/View/MvpViewController.m b/xplan-ios/Base/MVP/View/MvpViewController.m index bd76ae20..aae366b9 100644 --- a/xplan-ios/Base/MVP/View/MvpViewController.m +++ b/xplan-ios/Base/MVP/View/MvpViewController.m @@ -78,18 +78,36 @@ } ///实名认证弹窗 -- (void)showRealNameAuthenticationTipsAlertView { +- (void)showRealNameAuthenticationTipsAlertView:(NSString *)text isShowRoom:(BOOL)isShowRoom{ TTAlertConfig *config = [[TTAlertConfig alloc] init]; - config.message = @"为了营造更安全的网络环境\n保护您和他人的财产安全\n请先进行实名认证"; + config.title = @"提示"; + config.message = text; config.messageLineSpacing = 4; config.confirmButtonConfig.title = @"前往认证"; config.confirmButtonConfig.titleColor = UIColor.whiteColor; config.confirmButtonConfig.backgroundColor = [ThemeColor appMainColor]; + NSArray *configList ; + + TTAlertMessageAttributedConfig *roomAtt = [[TTAlertMessageAttributedConfig alloc] init]; + roomAtt.text = @"开通个人房间前"; + roomAtt.color = [ThemeColor appMainColor]; + + + + TTAlertMessageAttributedConfig *nameAttrConf = [[TTAlertMessageAttributedConfig alloc] init]; nameAttrConf.text = @"实名认证"; nameAttrConf.color = [ThemeColor appMainColor]; - config.messageAttributedConfig = @[nameAttrConf]; + + + if(isShowRoom){ + configList = @[roomAtt,nameAttrConf]; + }else{ + configList = @[nameAttrConf]; + } + + config.messageAttributedConfig = configList; @kWeakify(self); [TTPopup alertWithConfig:config confirmHandler:^{ diff --git a/xplan-ios/Global/XPHtmlUrl.h b/xplan-ios/Global/XPHtmlUrl.h index 6a8db8bb..e96091c8 100644 --- a/xplan-ios/Global/XPHtmlUrl.h +++ b/xplan-ios/Global/XPHtmlUrl.h @@ -86,6 +86,8 @@ typedef NS_ENUM(NSUInteger, URLType) { kXinZuoStarURL, ///特权卡 kPrivilegeCardURL, + ///礼物等级说明 + kGiftLevelURL, }; NSString * const URLWithType(URLType type); diff --git a/xplan-ios/Global/XPHtmlUrl.m b/xplan-ios/Global/XPHtmlUrl.m index ecdb13e7..ee61eadf 100644 --- a/xplan-ios/Global/XPHtmlUrl.m +++ b/xplan-ios/Global/XPHtmlUrl.m @@ -55,6 +55,7 @@ NSString * const URLWithType(URLType type) { @(kRedPacketRuleURL) : @"modules/rule/red-packet-rule.html",///红包规则 @(kXinZuoStarURL) : @"activity/act-constellation/index.html",///星座礼物 @(kPrivilegeCardURL) : @"modules/rule/privilegeCardRule.html",///特权卡说明 + @(kGiftLevelURL) : @"modules/rule/giftWallRule.html",///礼物等级说明 }; NSString * url = [dic objectForKey:@(type)]; return [NSString stringWithFormat:@"%@/%@",prefix, url]; diff --git a/xplan-ios/Info.plist b/xplan-ios/Info.plist index 7c3e4a2a..2b5cb3e8 100644 --- a/xplan-ios/Info.plist +++ b/xplan-ios/Info.plist @@ -136,6 +136,8 @@ linkedme_key + New item + “音萌”需要您的同意,才可以访问进行拍照并上传您的图片,然后展示在您的个人主页上,便于他人查看 live 4e75ead0ff84424339dc8b0616e7094c diff --git a/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeMakeFriendVC.m b/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeMakeFriendVC.m index 4316bcc5..40dfcff8 100644 --- a/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeMakeFriendVC.m +++ b/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeMakeFriendVC.m @@ -274,7 +274,7 @@ } } else { if(code == 10108){ - [self showRealNameAuthenticationTipsAlertView]; + [self showRealNameAuthenticationTipsAlertView:@"为了营造更安全的网络环境\n在 开通个人房间前\n需要先进行实名认证" isShowRoom:YES]; return; } [XCHUDTool showErrorWithMessage:msg]; diff --git a/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeMoreGameVC.m b/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeMoreGameVC.m index e9fc5ddb..3b1d0bff 100644 --- a/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeMoreGameVC.m +++ b/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeMoreGameVC.m @@ -116,7 +116,7 @@ } } else { if(code == 10108){ - [self showRealNameAuthenticationTipsAlertView]; + [self showRealNameAuthenticationTipsAlertView:@"为了营造更安全的网络环境\n在 开通个人房间前\n需要先进行实名认证" isShowRoom:YES]; return; } [XCHUDTool showErrorWithMessage:msg]; diff --git a/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomePartyVC.m b/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomePartyVC.m index 431d3155..082ca6ed 100644 --- a/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomePartyVC.m +++ b/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomePartyVC.m @@ -179,7 +179,7 @@ } } else { if(code == 10108){ - [self showRealNameAuthenticationTipsAlertView]; + [self showRealNameAuthenticationTipsAlertView:@"为了营造更安全的网络环境\n在 开通个人房间前\n需要先进行实名认证" isShowRoom:YES]; return; } [XCHUDTool showErrorWithMessage:msg]; diff --git a/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeViewController.m b/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeViewController.m index a4b2b851..d6f7eb36 100644 --- a/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeViewController.m +++ b/xplan-ios/Main/Home/View/Mew/MewHomeView/MewMainHomeViewController.m @@ -233,6 +233,10 @@ if (code == 200) { RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data]; if (roomInfo.isReselect) { + if(self.mewInfoModel.isCertified == NO){ + [self showRealNameAuthenticationTipsAlertView:@"为了营造更安全的网络环境\n在 开通个人房间前\n需要先进行实名认证" isShowRoom:YES] ; + return; + } XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init]; roomOpenView.roomInfo = roomInfo; roomOpenView.currentVC = self; @@ -243,7 +247,7 @@ } else { if(code == 10108 && self.mewInfoModel){ if(self.mewInfoModel.isCertified == NO){ - [self showRealNameAuthenticationTipsAlertView]; + [self showRealNameAuthenticationTipsAlertView:@"为了营造更安全的网络环境\n在 开通个人房间前\n需要先进行实名认证" isShowRoom:YES]; } return; } diff --git a/xplan-ios/Main/IM/Model/AttachmentModel.h b/xplan-ios/Main/IM/Model/AttachmentModel.h index 3b102a68..c2dad540 100644 --- a/xplan-ios/Main/IM/Model/AttachmentModel.h +++ b/xplan-ios/Main/IM/Model/AttachmentModel.h @@ -104,6 +104,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) { CustomMessageType_Starred_Kitchen = 96, ///小时榜更新 CustomMessageType_Hour_Update = 97, + ///礼物升级更新 + CustomMessageType_UnlockGift_Update = 98, ///特权卡 CustomMessageType_Privilege_Card = 102, ///发起邀请 @@ -555,6 +557,13 @@ typedef NS_ENUM(NSInteger, CustomMessageHourUpdate) { Custom_Message_Sub_Hour_Update = 971, +}; +//解锁礼物升级 CustomMessageType_UnlockGift_Update +typedef NS_ENUM(NSInteger, CustomMessageUnlockGiftUpdate) { + + Custom_Message_Sub_UnlockGift = 981, + Custom_Message_Sub_DressUpGift = 982, + }; ///发起邀请 CustomMessageType_Initiat_Invitation diff --git a/xplan-ios/Main/Login/View/LoginFullInfoViewController.m b/xplan-ios/Main/Login/View/LoginFullInfoViewController.m index 545e4f20..15750363 100644 --- a/xplan-ios/Main/Login/View/LoginFullInfoViewController.m +++ b/xplan-ios/Main/Login/View/LoginFullInfoViewController.m @@ -200,7 +200,7 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey; if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].avatarUrl.length > 0) { avatar = [self.presenter getThirdUserInfo].avatarUrl; } else { - avatar = @"https://image.nnbc123.cn/default_avatar.png"; + avatar = @"https://image.pekolive.com/default_image.png"; } return avatar; } diff --git a/xplan-ios/Main/Login/View/LoginViewController.m b/xplan-ios/Main/Login/View/LoginViewController.m index 187769cc..6b45849f 100644 --- a/xplan-ios/Main/Login/View/LoginViewController.m +++ b/xplan-ios/Main/Login/View/LoginViewController.m @@ -80,6 +80,11 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { [self setUpConstraints]; [self setEvents]; [self loginAnimation]; + NTESQuickLoginManager *qlManager = [NTESQuickLoginManager sharedInstance]; + BOOL shouldQL = [qlManager shouldQuickLogin]; + if (!shouldQL) { + [_loginButton setTitle:@"手机号登录" forState:UIControlStateNormal]; + } } - (void)viewWillAppear:(BOOL)animated { @@ -168,6 +173,9 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { make.bottom.mas_equalTo(self.authBubbleView).mas_offset(-6); }]; + + + //#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 // [self.appleButton mas_makeConstraints:^(MASConstraintMaker *make) { // make.width.mas_equalTo(50); @@ -245,7 +253,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { } - (void)phoneQuickLogin { - [self showLoading]; + // 在使用一键登录之前,请先调用shouldQuickLogin方法,判断当前上网卡的网络环境和运营商是否可以一键登录 @weakify(self) NTESQuickLoginManager *qlManager = [NTESQuickLoginManager sharedInstance]; @@ -254,6 +262,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { [self phoneQuickLoginFail]; return; } + [self showLoading]; [qlManager registerWithBusinessID:KeyWithType(KeyType_NTESQuickLoginBusinessId) configURL:nil extData:nil]; [qlManager getPhoneNumberCompletion:^(NSDictionary * _Nonnull resultDic) { @strongify(self) @@ -298,7 +307,7 @@ typedef NS_ENUM(NSUInteger, XYLoginType) { } - (void)phoneQuickLoginFail { - [self showErrorToast:@"一键登录失败,请检查手机网络状态。"]; +// [self showErrorToast:@"一键登录失败,请检查手机网络状态。"]; LoginPhoneViewController *inputPhoneVC = [[LoginPhoneViewController alloc] init]; [self.navigationController pushViewController:inputPhoneVC animated:YES]; } diff --git a/xplan-ios/Main/Message/View/Session/Content/MessageContentTweetView.m b/xplan-ios/Main/Message/View/Session/Content/MessageContentTweetView.m index f1522ef4..af5200c0 100644 --- a/xplan-ios/Main/Message/View/Session/Content/MessageContentTweetView.m +++ b/xplan-ios/Main/Message/View/Session/Content/MessageContentTweetView.m @@ -90,7 +90,7 @@ CGFloat desHeight = [model.desc boundingRectWithSize:CGSizeMake(240, CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin - attributes:[self messageTextAttibutes:[UIFont systemFontOfSize:13] color:[ThemeColor mainTextColor]] context:nil].size.height; + attributes:[self messageTextAttibutes:[UIFont systemFontOfSize:13] color:[ThemeColor mainTextColor]] context:nil].size.height + 10; [self.subTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(desHeight); }]; diff --git a/xplan-ios/Main/Mine/Model/UserInfo/UserGiftWallInfoModel.h b/xplan-ios/Main/Mine/Model/UserInfo/UserGiftWallInfoModel.h index a313b885..21c39af9 100644 --- a/xplan-ios/Main/Mine/Model/UserInfo/UserGiftWallInfoModel.h +++ b/xplan-ios/Main/Mine/Model/UserInfo/UserGiftWallInfoModel.h @@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,copy) NSString *picUrl; ///个数 @property (nonatomic,assign) NSInteger reciveCount; +@property(nonatomic,assign) int giftLevel; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/Presenter/XPMineUserInfoEditPresenter.m b/xplan-ios/Main/Mine/Presenter/XPMineUserInfoEditPresenter.m index 9130cb3f..fc0bf7db 100644 --- a/xplan-ios/Main/Mine/Presenter/XPMineUserInfoEditPresenter.m +++ b/xplan-ios/Main/Mine/Presenter/XPMineUserInfoEditPresenter.m @@ -8,10 +8,11 @@ #import "XPMineUserInfoEditPresenter.h" ///Api #import "Api+Mine.h" +#import "NSMutableDictionary+Saft.h" ///Tool #import "AccountInfoStorage.h" #import "UploadImage.h" -#import "NSMutableDictionary+Saft.h" + ///Model #import "XPMineUserInfoEditModel.h" #import "UserInfoModel.h" diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftCollectionViewCell.m b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftCollectionViewCell.m index 83045f7d..887d8da6 100644 --- a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftCollectionViewCell.m +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftCollectionViewCell.m @@ -22,6 +22,7 @@ @property (nonatomic,strong) NetImageView *giftImageView; ///礼物个数 @property (nonatomic,strong) UILabel *giftNumberLabel; + @end @implementation XPMineDataGiftCollectionViewCell diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftHeadCell.h b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftHeadCell.h new file mode 100644 index 00000000..09ac5357 --- /dev/null +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftHeadCell.h @@ -0,0 +1,26 @@ +// +// XPMineDataGiftHeadCell.h +// xplan-ios +// +// Created by duoban on 2024/1/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class XPMineDataGiftHeadCell, UserGiftWallInfoModel; +@protocol XPMineDataGiftHeadCellDelegate + +- (void)xPMineDataGiftHeadCell:(XPMineDataGiftHeadCell *)view didClickMore:(UIButton *)sender; +- (void)xPMineDataGiftHeadCell:(XPMineDataGiftHeadCell *)view didClickNormal:(UIButton *)sender; +- (void)xPMineDataGiftHeadCell:(XPMineDataGiftHeadCell *)view didClickLucky:(UIButton *)sender; +@end +@interface XPMineDataGiftHeadCell : UICollectionViewCell +@property(nonatomic,copy) NSString *userId; + +///代理 +@property (nonatomic,weak) id delegate; +@end + + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftHeadCell.m b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftHeadCell.m new file mode 100644 index 00000000..ea2ec756 --- /dev/null +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftHeadCell.m @@ -0,0 +1,198 @@ +// +// XPMineDataGiftHeadCell.m +// xplan-ios +// +// Created by duoban on 2024/1/30. +// + +#import "XPMineDataGiftHeadCell.h" + +@interface XPMineDataGiftHeadCell () +@property (nonatomic,strong) UIButton *arrowButton; +///标题 +@property (nonatomic,strong) UILabel *titleLabel; +@property(nonatomic,strong) UIImageView *tipsView; +@property(nonatomic,strong) UILabel *levelTitelView; +@property(nonatomic,strong) UIButton *normalGiftBtn; +@property(nonatomic,strong) UIButton *luckyGiftBtn; +@property(nonatomic,strong) UIView *lineView; +@property(nonatomic,strong) UIView *bgView; +@end + +@implementation XPMineDataGiftHeadCell +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + self.contentView.backgroundColor = [UIColor whiteColor]; + [self.contentView addSubview:self.bgView]; + [self.contentView addSubview:self.titleLabel]; + [self.contentView addSubview:self.tipsView]; + [self.contentView addSubview:self.levelTitelView]; + [self.contentView addSubview:self.arrowButton]; + [self.contentView addSubview:self.normalGiftBtn]; + [self.contentView addSubview:self.luckyGiftBtn]; + [self.contentView addSubview:self.lineView]; +} +-(void)installConstraints{ + [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.right.equalTo(self.contentView); + make.height.mas_equalTo(10); + }]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.contentView).offset(12); + make.top.mas_equalTo(self.contentView).offset(18); + }]; + [self.levelTitelView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-13); + make.centerY.equalTo(self.titleLabel); + }]; + [self.tipsView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.levelTitelView.mas_left).mas_offset(-4); + make.centerY.equalTo(self.levelTitelView); + make.width.height.mas_equalTo(12); + }]; + [self.arrowButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(12); + make.left.equalTo(self.tipsView); + make.right.equalTo(self.levelTitelView); + make.centerY.equalTo(self.titleLabel); + }]; + [self.normalGiftBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(62); + make.right.equalTo(self.contentView.mas_centerX).mas_offset(-20); + make.width.mas_equalTo(58); + make.height.mas_equalTo(20); + }]; + [self.luckyGiftBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(62); + make.left.equalTo(self.contentView.mas_centerX).mas_offset(20); + make.width.mas_equalTo(58); + make.height.mas_equalTo(20); + }]; + [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(13); + make.height.mas_equalTo(4); + make.top.equalTo(self.normalGiftBtn.mas_bottom).mas_offset(1); + make.centerX.equalTo(self.normalGiftBtn); + }]; +} +-(void)didClickBtnAction:(UIButton *)sender{ + + if(sender == self.normalGiftBtn){ + self.normalGiftBtn.selected = YES; + self.luckyGiftBtn.selected = NO; + self.normalGiftBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; + self.luckyGiftBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; + [self.lineView.superview layoutIfNeeded]; + [UIView animateWithDuration:0.5 animations:^{ + [self.lineView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(13); + make.height.mas_equalTo(4); + make.top.equalTo(self.normalGiftBtn.mas_bottom).mas_offset(1); + make.centerX.equalTo(self.normalGiftBtn); + }]; + }]; + if(self.delegate && [self.delegate respondsToSelector:@selector(xPMineDataGiftHeadCell:didClickNormal:)]){ + [self.delegate xPMineDataGiftHeadCell:self didClickNormal:sender]; + } + return; + } + self.normalGiftBtn.selected = NO; + self.luckyGiftBtn.selected = YES; + self.luckyGiftBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; + self.normalGiftBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; + [self.lineView.superview layoutIfNeeded]; + [UIView animateWithDuration:0.5 animations:^{ + [self.lineView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(13); + make.height.mas_equalTo(4); + make.top.equalTo(self.normalGiftBtn.mas_bottom).mas_offset(1); + make.centerX.equalTo(self.luckyGiftBtn); + }]; + }]; + if(self.delegate && [self.delegate respondsToSelector:@selector(xPMineDataGiftHeadCell:didClickLucky:)]){ + [self.delegate xPMineDataGiftHeadCell:self didClickLucky:sender]; + } +} +-(void)arrowButtonAction:(UIButton *)sender{ + if(self.delegate && [self.delegate respondsToSelector:@selector(xPMineDataGiftHeadCell:didClickMore:)]){ + [self.delegate xPMineDataGiftHeadCell:self didClickMore:sender]; + } +} +#pragma mark - 懒加载 +- (UIButton *)normalGiftBtn{ + if(!_normalGiftBtn){ + _normalGiftBtn = [UIButton new]; + [_normalGiftBtn setTitle:@"普通礼物" forState:UIControlStateNormal]; + [_normalGiftBtn setTitleColor:UIColorFromRGB(0x2B2D33) forState:UIControlStateSelected]; + [_normalGiftBtn setTitleColor:UIColorFromRGB(0xA2A7B8) forState:UIControlStateNormal]; + _normalGiftBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; + _normalGiftBtn.selected = YES; + [_normalGiftBtn addTarget:self action:@selector(didClickBtnAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _normalGiftBtn; +} +- (UIButton *)luckyGiftBtn{ + if(!_luckyGiftBtn){ + _luckyGiftBtn = [UIButton new]; + [_luckyGiftBtn setTitle:@"幸运礼物" forState:UIControlStateNormal]; + [_luckyGiftBtn setTitleColor:UIColorFromRGB(0x2B2D33) forState:UIControlStateSelected]; + [_luckyGiftBtn setTitleColor:UIColorFromRGB(0xA2A7B8) forState:UIControlStateNormal]; + _luckyGiftBtn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular]; + [_luckyGiftBtn addTarget:self action:@selector(didClickBtnAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _luckyGiftBtn; +} +- (UIImageView *)tipsView{ + if(!_tipsView){ + _tipsView = [UIImageView new]; + _tipsView.image = kImage(@"mine_user_info_gift_tip_icon"); + } + return _tipsView; +} +- (UILabel *)levelTitelView{ + if(!_levelTitelView){ + _levelTitelView = [UILabel labelInitWithText:@"礼物等级说明" font:[UIFont systemFontOfSize:11 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0xA2A7B8)]; + } + return _levelTitelView; +} +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.text = @"礼物墙"; + _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; + _titleLabel.textColor = [ThemeColor mainTextColor]; + } + return _titleLabel; +} +- (UIButton *)arrowButton { + if (!_arrowButton) { + _arrowButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_arrowButton addTarget:self action:@selector(arrowButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [_arrowButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; + } + return _arrowButton; +} +- (UIView *)lineView{ + if(!_lineView){ + _lineView = [UIView new]; + _lineView.backgroundColor = UIColorFromRGB(0xFFDA24); + _lineView.layer.cornerRadius = 2; + _lineView.layer.masksToBounds = YES; + } + return _lineView; +} +- (UIView *)bgView{ + if(!_bgView){ + _bgView = [UIView new]; + _bgView.backgroundColor = UIColorFromRGB(0xF8F8FB); + } + return _bgView; +} +@end diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftTableViewCell.h b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftTableViewCell.h index c11491f2..9b05100a 100644 --- a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftTableViewCell.h +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftTableViewCell.h @@ -15,10 +15,8 @@ NS_ASSUME_NONNULL_BEGIN @end @interface XPMineDataGiftTableViewCell : UITableViewCell -///礼物墙中的礼物 -@property (nonatomic,strong) NSArray *userGiftWall; -///礼物墙中的幸运礼物礼物 -@property (nonatomic,strong) NSArray *userLuckyBagGiftWall; +@property(nonatomic,copy) NSString *userId; + ///代理 @property (nonatomic,weak) id delegate; @end diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftTableViewCell.m b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftTableViewCell.m index e4247b49..85f3c966 100644 --- a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftTableViewCell.m +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataGiftTableViewCell.m @@ -25,6 +25,9 @@ @property (nonatomic,strong) UIImageView * backImageView; ///显示更多 @property (nonatomic,strong) UIButton *arrowButton; + +@property(nonatomic,strong) UIImageView *tipsView; +@property(nonatomic,strong) UILabel *levelTitelView; ///标题 @property (nonatomic,strong) UILabel *titleLabel; ///分页标题 @@ -56,6 +59,8 @@ [self.contentView addSubview:self.backImageView]; [self.backImageView addSubview:self.titleLabel]; + [self.backImageView addSubview:self.tipsView]; + [self.backImageView addSubview:self.levelTitelView]; [self.backImageView addSubview:self.arrowButton]; [self.backImageView addSubview:self.titleView]; [self.backImageView addSubview:self.containerView]; @@ -72,11 +77,20 @@ make.left.mas_equalTo(self.backImageView).offset(15); make.top.mas_equalTo(self.backImageView).offset(12); }]; - + [self.levelTitelView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-13); + make.centerY.equalTo(self.titleLabel); + }]; + [self.tipsView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.levelTitelView.mas_left).mas_offset(-4); + make.centerY.equalTo(self.levelTitelView); + make.width.height.mas_equalTo(12); + }]; [self.arrowButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(13, 22)); - make.centerY.mas_equalTo(self.titleView); - make.right.mas_equalTo(self.backImageView).offset(-15); + make.height.mas_equalTo(12); + make.left.equalTo(self.tipsView); + make.right.equalTo(self.levelTitelView); + make.centerY.equalTo(self.titleLabel); }]; [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -111,23 +125,10 @@ } } -#pragma mark - Getters And Setters -- (void)setUserGiftWall:(NSArray *)userGiftWall { - _userGiftWall = userGiftWall; - if (_userGiftWall.count > 12) { - NSMutableArray * array = [_userGiftWall mutableCopy]; - _userGiftWall = [array subarrayWithRange:NSMakeRange(0, 12)]; - } - self.normalGiftView.datasource = _userGiftWall; -} - -- (void)setUserLuckyBagGiftWall:(NSArray *)userLuckyBagGiftWall { - _userLuckyBagGiftWall = userLuckyBagGiftWall; - if (_userLuckyBagGiftWall.count > 12) { - NSMutableArray * array = [_userLuckyBagGiftWall mutableCopy]; - _userLuckyBagGiftWall = [array subarrayWithRange:NSMakeRange(0, 12)]; - } - self.luckyGiftView.datasource = _userLuckyBagGiftWall; +-(void)setUserId:(NSString *)userId{ + _userId = userId; + self.normalGiftView.userId = _userId; + self.luckyGiftView.userId = _userId; } - (UIImageView *)backImageView { @@ -152,8 +153,6 @@ - (UIButton *)arrowButton { if (!_arrowButton) { _arrowButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_arrowButton setImage:[UIImage imageNamed:@"room_setting_arrow"] forState:UIControlStateNormal]; - [_arrowButton setImage:[UIImage imageNamed:@"room_setting_arrow"] forState:UIControlStateSelected]; [_arrowButton addTarget:self action:@selector(arrowButtonAction:) forControlEvents:UIControlEventTouchUpInside]; [_arrowButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; } @@ -205,16 +204,28 @@ - (XPMineUserInfoGiftView *)normalGiftView { if (!_normalGiftView) { - _normalGiftView = [[XPMineUserInfoGiftView alloc] init]; + _normalGiftView = [[XPMineUserInfoGiftView alloc] initWithFrame:CGRectZero type:@"1"]; } return _normalGiftView; } - (XPMineUserInfoGiftView *)luckyGiftView { if (!_luckyGiftView) { - _luckyGiftView = [[XPMineUserInfoGiftView alloc] init]; + _luckyGiftView = [[XPMineUserInfoGiftView alloc] initWithFrame:CGRectZero type:@"2"];; } return _luckyGiftView; } - +- (UIImageView *)tipsView{ + if(!_tipsView){ + _tipsView = [UIImageView new]; + _tipsView.image = kImage(@"mine_user_info_gift_tip_icon"); + } + return _tipsView; +} +- (UILabel *)levelTitelView{ + if(!_levelTitelView){ + _levelTitelView = [UILabel labelInitWithText:@"礼物等级说明" font:[UIFont systemFontOfSize:11 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0xA2A7B8)]; + } + return _levelTitelView; +} @end diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataSkillCardCollectionViewCell.h b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataSkillCardCollectionViewCell.h new file mode 100644 index 00000000..86da4159 --- /dev/null +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataSkillCardCollectionViewCell.h @@ -0,0 +1,25 @@ +// +// XPMineDataSkillCardCollectionViewCell.h +// xplan-ios +// +// Created by duoban on 2024/1/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class XPMineDataSkillCardCollectionViewCell, MineSkillCardListInfoModel; +@protocol XPMineDataSkillCardCollectionViewCell + +- (void)xPMineDataSkillCardTableViewCell:(XPMineDataSkillCardCollectionViewCell *)view didSelectItem:(nullable MineSkillCardListInfoModel *)skillInfo; + +@end + +@interface XPMineDataSkillCardCollectionViewCell : UICollectionViewCell +@property (nonatomic,strong) NSArray *datasourece; +///代理 +@property (nonatomic,weak) id delegate; +@end + + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataSkillCardCollectionViewCell.m b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataSkillCardCollectionViewCell.m new file mode 100644 index 00000000..5d570b4d --- /dev/null +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineDataSkillCardCollectionViewCell.m @@ -0,0 +1,216 @@ +// +// XPMineDataSkillCardCollectionViewCell.m +// xplan-ios +// +// Created by duoban on 2024/1/30. +// + +#import "XPMineDataSkillCardCollectionViewCell.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "NSArray+Safe.h" +///View +#import "XPMineDataSkillDataCollectionViewCell.h" +@interface XPMineDataSkillCardCollectionViewCell() +///背景 +@property (nonatomic,strong) UIImageView * backImageView; +///标题 +@property (nonatomic,strong) UILabel *titleLabel; +///列表 +@property (nonatomic,strong) UICollectionView *collectionView; +///空的容器 +@property (nonatomic,strong) UIView *emptyView; +///为空 +@property (nonatomic,strong) UILabel *emptyLabel; +///箭头 +@property (nonatomic,strong) UIImageView *arrowImageView; +@property(nonatomic,strong) UIView *bgView; +@end +@implementation XPMineDataSkillCardCollectionViewCell +-(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 clearColor]; + [self.contentView addSubview:self.bgView]; + [self.contentView addSubview:self.backImageView]; + + [self.backImageView addSubview:self.titleLabel]; + [self.backImageView addSubview:self.collectionView]; + [self.backImageView addSubview:self.emptyView]; + + [self.emptyView addSubview:self.emptyLabel]; + [self.emptyView addSubview:self.arrowImageView]; +} + +- (void)initSubViewConstraints { + [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.equalTo(self.contentView); + make.height.mas_equalTo(10); + }]; + [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self.contentView).inset(0); + make.top.mas_equalTo(self.contentView).offset(22); + make.bottom.mas_equalTo(self.contentView); + }]; + + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.backImageView).offset(15); + make.top.mas_equalTo(self.backImageView).offset(12); + }]; + + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.titleLabel); + make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(18); + make.height.mas_equalTo(47); + make.right.mas_equalTo(self.backImageView).offset(-6); + }]; + + [self.emptyView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self.backImageView).inset(18); + make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(12); + make.height.mas_equalTo(47); + }]; + + [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(6.5, 11)); + make.centerY.mas_equalTo(self.emptyView); + make.right.mas_equalTo(self.emptyView).offset(-12); + }]; + + [self.emptyLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.emptyView); + make.centerX.mas_equalTo(self.emptyView); + }]; +} + +#pragma mark - UICollectionViewDelegate And UICollectionViewDatasource +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.datasourece.count; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + XPMineDataSkillDataCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineDataSkillDataCollectionViewCell class]) forIndexPath:indexPath]; + cell.skillInfo = [self.datasourece safeObjectAtIndex1:indexPath.row]; + return cell; +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + [collectionView deselectItemAtIndexPath:indexPath animated:YES]; + if (self.datasourece.count > 0) { + MineSkillCardListInfoModel * skillInfo = [self.datasourece safeObjectAtIndex1:indexPath.row]; + if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineDataSkillCardTableViewCell:didSelectItem:)]) { + [self.delegate xPMineDataSkillCardTableViewCell:self didSelectItem:skillInfo]; + } + } +} + +- (void)tapEmptySkillCard { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineDataSkillCardTableViewCell:didSelectItem:)]) { + [self.delegate xPMineDataSkillCardTableViewCell:self didSelectItem:nil]; + } +} + +#pragma mark - Getters And Setters +- (void)setDatasourece:(NSArray *)datasourece { + _datasourece = datasourece; + if (_datasourece.count > 0) { + self.emptyView.hidden = YES; + self.collectionView.hidden = NO; + } else { + self.emptyView.hidden = NO; + self.collectionView.hidden = YES; + } + [self.collectionView reloadData]; +} + +- (UIImageView *)backImageView { + if (!_backImageView) { + _backImageView = [[UIImageView alloc] init]; + _backImageView.userInteractionEnabled = YES; + _backImageView.backgroundColor =[ThemeColor appCellBackgroundColor]; + } + return _backImageView; +} + + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.text = @"技能卡"; + _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; + _titleLabel.textColor = [ThemeColor mainTextColor]; + } + return _titleLabel; +} + +- (UICollectionView *)collectionView{ + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + layout.itemSize = CGSizeMake(142, 47); + layout.minimumLineSpacing = 10; + layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.dataSource = self; + _collectionView.showsHorizontalScrollIndicator = NO; + _collectionView.delegate = self; + _collectionView.tag = 1005; + _collectionView.backgroundColor = [UIColor clearColor]; + [_collectionView registerClass:[XPMineDataSkillDataCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineDataSkillDataCollectionViewCell class])]; + + } + return _collectionView; +} + +- (UIView *)emptyView { + if (!_emptyView) { + _emptyView = [[UIView alloc] init]; + _emptyView.backgroundColor = UIColorFromRGB(0xF4F7FF); + _emptyView.layer.masksToBounds = YES; + _emptyView.layer.cornerRadius = 8; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapEmptySkillCard)]; + [_emptyView addGestureRecognizer:tap]; + } + return _emptyView; +} + + +- (UIImageView *)arrowImageView { + if (!_arrowImageView) { + _arrowImageView = [[UIImageView alloc] init]; + _arrowImageView.userInteractionEnabled = YES; + _arrowImageView.image = [UIImage imageNamed:@"common_right_arrow"]; + } + return _arrowImageView; +} + +- (UILabel *)emptyLabel { + if (!_emptyLabel) { + _emptyLabel = [[UILabel alloc] init]; + _emptyLabel.text = @"还未添加技能卡喔"; + _emptyLabel.font = [UIFont systemFontOfSize:12]; + _emptyLabel.textAlignment = NSTextAlignmentCenter; + _emptyLabel.textColor = [ThemeColor secondTextColor]; + _emptyLabel.userInteractionEnabled = YES; + } + return _emptyLabel; +} +- (UIView *)bgView{ + if(!_bgView){ + _bgView = [UIView new]; + _bgView.backgroundColor = UIColorFromRGB(0xF8F8FB); + } + return _bgView; +} +@end diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoGiftWallCollectionViewCell.m b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoGiftWallCollectionViewCell.m index 56084c60..c0d68331 100644 --- a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoGiftWallCollectionViewCell.m +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoGiftWallCollectionViewCell.m @@ -16,10 +16,11 @@ #import "UserGiftWallInfoModel.h" @interface XPMineUserInfoGiftWallCollectionViewCell () +@property(nonatomic,strong) UIImageView *bgImageView; ///礼物的图片 @property (nonatomic,strong) NetImageView *giftImageView; ///礼物的数量 -@property (nonatomic,strong) UIButton *numberButton; +@property (nonatomic,strong) UILabel *numberButton; ///礼物的名 @property (nonatomic,strong) UILabel *giftNameLabel; ///礼物的价值容器 @@ -43,6 +44,7 @@ #pragma mark - Private Method - (void)initSubViews { self.backgroundColor = [UIColor clearColor]; + [self.contentView addSubview:self.bgImageView]; [self.contentView addSubview:self.giftImageView]; [self.contentView addSubview:self.numberButton]; [self.contentView addSubview:self.giftNameLabel]; @@ -53,21 +55,25 @@ } - (void)initSubViewConstraints { + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.contentView); + }]; [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self.contentView).inset(5); - make.top.mas_equalTo(self.contentView); - make.height.mas_equalTo(self.giftImageView.mas_width); + make.centerX.equalTo(self.contentView); + make.top.mas_equalTo(8); + make.height.width.mas_equalTo(56); }]; [self.numberButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(55, 15)); + make.height.mas_equalTo(14); make.centerX.mas_equalTo(self.contentView); - make.top.mas_equalTo(self.giftImageView.mas_bottom).offset(2); + make.top.mas_equalTo(self.giftImageView.mas_bottom).offset(1); }]; [self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(self.contentView); - make.top.mas_equalTo(self.numberButton.mas_bottom).offset(10); + make.top.mas_equalTo(self.numberButton.mas_bottom).offset(1); + make.height.mas_equalTo(17); }]; [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -76,8 +82,13 @@ }]; [self.diamondImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(13, 13)); + make.size.mas_equalTo(CGSizeMake(10, 8)); }]; + NSString *image = [NSString stringWithFormat:@"mine_user_infi_gift_bg%d",1]; + _bgImageView.image = kImage(image); + self.numberButton.textColor = UIColorFromRGB(0x7F8494); + self.giftNameLabel.textColor = UIColorFromRGB(0x696D7A); + self.giftPriceLabel.textColor = UIColorFromRGB(0x7F8494); } #pragma mark - Getters And Setters @@ -87,7 +98,15 @@ self.giftImageView.imageUrl = _giftInfo.picUrl; self.giftNameLabel.text = _giftInfo.giftName; self.giftPriceLabel.text = [NSString stringWithFormat:@"%ld", _giftInfo.giftPrice]; - [self.numberButton setTitle:[NSString stringWithFormat:@"X%ld", _giftInfo.reciveCount] forState:UIControlStateNormal]; + self.numberButton.text = [NSString stringWithFormat:@"x%ld", _giftInfo.reciveCount]; + if(_giftInfo.giftLevel > 0){ + NSString *image = [NSString stringWithFormat:@"mine_user_infi_gift_bg%d",_giftInfo.giftLevel]; + _bgImageView.image = kImage(image); + self.numberButton.textColor = _giftInfo.giftLevel == 1 ? UIColorFromRGB(0x7F8494):UIColorFromRGB(0xF5F6FA); + self.giftNameLabel.textColor = _giftInfo.giftLevel == 1 ? UIColorFromRGB(0x696D7A):UIColorFromRGB(0xFFFFFF); + self.giftPriceLabel.textColor = _giftInfo.giftLevel == 1 ? UIColorFromRGB(0x7F8494):UIColorFromRGB(0xF5F6FA); + } + } } @@ -103,14 +122,12 @@ return _giftImageView; } -- (UIButton *)numberButton { +- (UILabel *)numberButton { if (!_numberButton) { - _numberButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_numberButton setBackgroundColor:[ThemeColor appCellBackgroundColor]]; - [_numberButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; - _numberButton.titleLabel.font = [UIFont systemFontOfSize:10]; - _numberButton.layer.masksToBounds = YES; - [_numberButton setCornerWithLeftTopCorner:2 rightTopCorner:6 bottomLeftCorner:6 bottomRightCorner:2 size:CGSizeMake(55, 15)]; + _numberButton = [UILabel new]; + _numberButton.text = @"0"; + _numberButton.font = [UIFont systemFontOfSize:10 weight:UIFontWeightRegular]; + _numberButton.textAlignment = NSTextAlignmentCenter; } return _numberButton; } @@ -118,8 +135,7 @@ - (UILabel *)giftNameLabel { if (!_giftNameLabel) { _giftNameLabel = [[UILabel alloc] init]; - _giftNameLabel.font = [UIFont systemFontOfSize:13]; - _giftNameLabel.textColor = [ThemeColor mainTextColor]; + _giftNameLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; _giftNameLabel.textAlignment = NSTextAlignmentCenter; } return _giftNameLabel; @@ -148,11 +164,16 @@ - (UILabel *)giftPriceLabel { if (!_giftPriceLabel) { _giftPriceLabel = [[UILabel alloc] init]; - _giftPriceLabel.font = [UIFont systemFontOfSize:11]; + _giftPriceLabel.font = [UIFont systemFontOfSize:9 weight:UIFontWeightRegular]; _giftPriceLabel.textColor = [ThemeColor secondTextColor]; } return _giftPriceLabel; } - +- (UIImageView *)bgImageView{ + if(!_bgImageView){ + _bgImageView = [UIImageView new]; + } + return _bgImageView; +} @end diff --git a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoTableViewCell.m b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoTableViewCell.m index 028e241e..df13aa65 100644 --- a/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoTableViewCell.m +++ b/xplan-ios/Main/Mine/View/Cell/MineInfo/XPMineUserInfoTableViewCell.m @@ -90,7 +90,7 @@ if (_userInfo) { self.nameLabel.text = _userInfo.nick; self.idLabel.text = [NSString stringWithFormat:@"%@号:%ld",AppName, (long)_userInfo.erbanNo]; - self.signLabel.text = _userInfo.userDesc.length > 0 ? _userInfo.userDesc : @"我是个默认签名"; + self.signLabel.text = _userInfo.userDesc.length > 0 ? _userInfo.userDesc : @"他还没有写个人介绍~"; NSString * sexStr; if (_userInfo.gender == GenderType_Male) { sexStr = @"common_male"; diff --git a/xplan-ios/Main/Mine/View/DressUp/Model/CarModel.h b/xplan-ios/Main/Mine/View/DressUp/Model/CarModel.h index b792272d..c728f349 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Model/CarModel.h +++ b/xplan-ios/Main/Mine/View/DressUp/Model/CarModel.h @@ -31,6 +31,9 @@ typedef enum { @property (nonatomic, assign) BOOL isUsed; ///标签类型 @property (nonatomic, assign) DressUpLabelType labelType; +@property(nonatomic,copy) NSString *expireDays; +@property(nonatomic,copy) NSString *expireHour; +@property(nonatomic,copy) NSString *expireMinute; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/DressUp/Model/HeadwearModel.h b/xplan-ios/Main/Mine/View/DressUp/Model/HeadwearModel.h index 608d7e06..9db7062b 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Model/HeadwearModel.h +++ b/xplan-ios/Main/Mine/View/DressUp/Model/HeadwearModel.h @@ -31,11 +31,13 @@ typedef NS_ENUM(NSInteger, DressupHeadWearStatus) { @property (nonatomic, strong) NSString *pic; ///效果 @property (nonatomic, strong) NSString *effect; -///还有过期 -@property (nonatomic, strong) NSString *expireDays; + ///状态 @property (nonatomic, assign) DressupHeadWearStatus status; +@property(nonatomic,copy) NSString *expireDays; +@property(nonatomic,copy) NSString *expireHour; +@property(nonatomic,copy) NSString *expireMinute; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/DressUp/Model/NameplateModel.h b/xplan-ios/Main/Mine/View/DressUp/Model/NameplateModel.h index 1f8d3f20..0f6562f3 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Model/NameplateModel.h +++ b/xplan-ios/Main/Mine/View/DressUp/Model/NameplateModel.h @@ -22,6 +22,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) BOOL isExpired; ///过期的天数 @property (nonatomic,copy) NSString *expireDays; +@property(nonatomic,copy) NSString * expireHour; +@property(nonatomic,copy) NSString * expireMinute; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/DressUp/Model/NobleCardModel.h b/xplan-ios/Main/Mine/View/DressUp/Model/NobleCardModel.h index 28cc0ebb..aa7c4758 100644 --- a/xplan-ios/Main/Mine/View/DressUp/Model/NobleCardModel.h +++ b/xplan-ios/Main/Mine/View/DressUp/Model/NobleCardModel.h @@ -15,8 +15,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString *cardId; ///来源:1:购买 2:官方赠送 @property (nonatomic, assign) NSInteger comeFrom; -///过期时间(天) -@property (nonatomic, assign) NSInteger expireDays; ///过期时间 @property (nonatomic, strong) NSString *expireTime; ///是否过期 @@ -28,6 +26,9 @@ NS_ASSUME_NONNULL_BEGIN ///是否使用中 @property (nonatomic, assign) BOOL used; +@property(nonatomic,copy) NSString *expireDays; +@property(nonatomic,copy) NSString *expireHour; +@property(nonatomic,copy) NSString *expireMinute; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineCarTableViewCell.m b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineCarTableViewCell.m index e6bd3ff1..388a97a1 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineCarTableViewCell.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineCarTableViewCell.m @@ -115,7 +115,7 @@ self.titleLabel.text = _carInfo.name; self.useButton.hidden = _carInfo.status != Dressup_Car_Status_Ok; if (_carInfo.status == Dressup_Car_Status_Ok) { - self.timeLabel.text = [NSString stringWithFormat:@"剩余%ld天", _carInfo.expireDate]; + self.timeLabel.text = [NSString stringWithFormat:@"剩余 %@ 天 %@ 小时 %@ 分钟", _carInfo.expireDays,_carInfo.expireHour,_carInfo.expireHour]; } else { self.timeLabel.text = @"已过期"; } diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineHeadwearTableViewCell.m b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineHeadwearTableViewCell.m index 6a9c847a..d3190d92 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineHeadwearTableViewCell.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineHeadwearTableViewCell.m @@ -119,7 +119,7 @@ self.titleLabel.text = _headwearModel.headwearName; self.useButton.hidden = _headwearModel.status != Dressup_Headwear_Status_Ok; if (_headwearModel.status == Dressup_Headwear_Status_Ok) { - self.timeLabel.text = [NSString stringWithFormat:@"剩余%@天", _headwearModel.expireDays]; + self.timeLabel.text = [NSString stringWithFormat:@"剩余 %@ 天 %@ 小时 %@ 分钟", _headwearModel.expireDays,_headwearModel.expireHour,_headwearModel.expireHour]; } else { self.timeLabel.text = @"已过期"; } diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNameplateTableViewCell.m b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNameplateTableViewCell.m index d1b27836..8891da64 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNameplateTableViewCell.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNameplateTableViewCell.m @@ -90,7 +90,7 @@ self.titleLabel.text = _nameplateModel.nameplateName; self.useButton.hidden = _nameplateModel.isExpired; if (!_nameplateModel.isExpired) { - self.timeLabel.text = [NSString stringWithFormat:@"剩余%@天", _nameplateModel.expireDays]; + self.timeLabel.text = [NSString stringWithFormat:@"剩余 %@ 天 %@ 小时 %@ 分钟", _nameplateModel.expireDays,_nameplateModel.expireHour,_nameplateModel.expireHour];; } else { self.timeLabel.text = @"已过期"; } diff --git a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNobleCardTableViewCell.m b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNobleCardTableViewCell.m index 36e83e90..3e721a30 100644 --- a/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNobleCardTableViewCell.m +++ b/xplan-ios/Main/Mine/View/DressUp/View/Cell/XPMineNobleCardTableViewCell.m @@ -108,7 +108,7 @@ self.titleLabel.text = nobleCardModel.name; self.useButton.hidden = nobleCardModel.hasExpired; if (!nobleCardModel.hasExpired) { - self.timeLabel.text = [NSString stringWithFormat:@"剩余%zd天", nobleCardModel.expireDays]; + self.timeLabel.text = [NSString stringWithFormat:@"剩余 %@ 天 %@ 小时 %@ 分钟", nobleCardModel.expireDays,nobleCardModel.expireHour,nobleCardModel.expireHour]; } else { self.timeLabel.text = @"已过期"; } diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserDataViewController.m b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserDataViewController.m index 3bc75c86..bfaed862 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserDataViewController.m +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserDataViewController.m @@ -11,9 +11,10 @@ ///Tool #import "AccountInfoStorage.h" #import "XPMacro.h" +#import "XPWebViewController.h" ///View -#import "XPMineDataSkillCardTableViewCell.h" -#import "XPMineDataGiftTableViewCell.h" +#import "XPMineDataSkillCardCollectionViewCell.h" +#import "XPMineDataGiftHeadCell.h" ///Model #import "ClanDetailInfoModel.h" #import "UserInfoModel.h" @@ -21,25 +22,28 @@ ///P #import "XPMineUserDataPresenter.h" #import "XPMineUserDataProtocol.h" +#import "Api+Mine.h" ///View #import "XPSkillCardViewController.h" #import "XPMineUserInfoGiftWallViewController.h" #import "XPMineClanViewController.h" #import "XPMineGuildViewController.h" -@interface XPMineUserDataViewController () +#import "XPMineUserInfoGiftWallCollectionViewCell.h" +#import "XPMineUserInfoEmptyCollectionViewCell.h" +@interface XPMineUserDataViewController () ///列表 -@property (nonatomic,strong) UITableView *tableView; +@property (nonatomic,strong) UICollectionView *collectionView; ///家族信息 @property (nonatomic,strong) ClanDetailInfoModel *clanDetailInfo; ///技能卡 @property (nonatomic,strong) NSArray *skillArray; -///是否折叠 -@property (nonatomic,assign) BOOL isFold; -@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); -///是否展示加入家族房间 -@property (nonatomic,assign) BOOL isShowEnterClan; -@property (nonatomic, strong) XPMineDataGiftTableViewCell *giftCell; +@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); +@property (nonatomic,copy) NSArray *datasource; +@property (nonatomic,copy) NSArray *normalSource; +@property (nonatomic,copy) NSArray *luckySource; + + @end @@ -61,80 +65,98 @@ } #pragma mark - Http - (void)initHettpRequest { - self.isFold = YES; - self.isShowEnterClan = NO; [self.presenter getUserSkillCardList:self.userUid]; -// [self.presenter getClanDetailInfo:self.userUid currentUserUid:[AccountInfoStorage instance].getUid]; + [Api getUserGiftWall:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if(data.code == 200){ + NSArray * array= [UserGiftWallInfoModel modelsWithArray:data.data]; + self.datasource = [NSMutableArray arrayWithArray:array]; + self.normalSource = [NSMutableArray arrayWithArray:array]; + [self.collectionView reloadData]; + } + } uid:self.userUid giftType:@"1"]; + [Api getUserGiftWall:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if(data.code == 200){ + NSArray * array= [UserGiftWallInfoModel modelsWithArray:data.data]; + self.luckySource = [NSMutableArray arrayWithArray:array]; + } + } uid:self.userUid giftType:@"2"]; } #pragma mark - Private Method - (void)initSubViews { - [self.view addSubview:self.tableView]; + [self.view addSubview:self.collectionView]; } - (void)initSubViewConstraints { - [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.view); }]; } #pragma mark - UITableViewDelegate And UITableViewDataSource -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2; -} -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - if(section == 0) { - return (self.userUid.integerValue == [AccountInfoStorage instance].getUid.integerValue || self.skillArray.count > 0); +-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{ + return 3; +} +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + if(section == 0) { + return (self.userUid.integerValue == [AccountInfoStorage instance].getUid.integerValue || self.skillArray.count > 0); }else if (section == 1) { return 1; } - return 0; + return self.datasource.count > 0 ? self.datasource.count : 1; } -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section == 0) { - return 133; - } else if(indexPath.section == 1) { - CGFloat itemWidth = (CGRectGetWidth(self.view.frame) - 20*2 - 16*3)/4.0; - CGFloat itemHeight = 82.0/72.0*itemWidth; - CGFloat topHeight = 100; - return itemHeight * 3 + 14 * 2 + topHeight + 25+20; - } else { - return 0; - } +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.section == 0) { + return CGSizeMake(KScreenWidth, 143); + } else if(indexPath.section == 1) { + return CGSizeMake(KScreenWidth,103); + } else { + return self.datasource.count > 0? CGSizeMake(84, 122) : collectionView.bounds.size; + } } - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath.section == 0) { - XPMineDataSkillCardTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDataSkillCardTableViewCell class])]; - if (cell == nil) { - cell = [[XPMineDataSkillCardTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDataSkillCardTableViewCell class])]; - } - cell.delegate = self; - cell.datasourece = self.skillArray; - return cell; - } else { - ///强引用这个cell,否则复用会导致问题 - if (self.giftCell == nil) { - XPMineDataGiftTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])]; - cell.delegate = self; - self.giftCell = cell; - } - self.giftCell.userGiftWall = self.userInfo.userGiftWall; - self.giftCell.userLuckyBagGiftWall = self.userInfo.userLuckyBagGiftWall; - return self.giftCell; - } +- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{ + return section == 2 ? UIEdgeInsetsMake(0, 12, 100, 12) : UIEdgeInsetsMake(0, 12, 0, 12);; +} +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + if(indexPath.section == 0){ + XPMineDataSkillCardCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineDataSkillCardCollectionViewCell class]) forIndexPath:indexPath]; + cell.delegate = self; + cell.datasourece = self.skillArray; + return cell; + }else if(indexPath.section == 1){ + XPMineDataGiftHeadCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineDataGiftHeadCell class]) forIndexPath:indexPath]; + cell.delegate = self; + return cell; + } + if (self.datasource.count > 0) { + XPMineUserInfoGiftWallCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoGiftWallCollectionViewCell class]) forIndexPath:indexPath]; + cell.giftInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; + + return cell; + } + + XPMineUserInfoEmptyCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoEmptyCollectionViewCell class]) forIndexPath:indexPath]; + cell.isGiftWall = YES; + return cell; } - #pragma mark - XPMineDataGiftTableViewCellDelegate -- (void)xPMineDataGiftTableViewCell:(XPMineDataGiftTableViewCell *)view didClickMore:(UIButton *)sender { - XPMineUserInfoGiftWallViewController * giftWallVC = [[XPMineUserInfoGiftWallViewController alloc] init]; - giftWallVC.userUid = self.userUid; - [self.navigationController pushViewController:giftWallVC animated:YES]; +- (void)xPMineDataGiftHeadCell:(XPMineDataGiftHeadCell *)view didClickMore:(UIButton *)sender { + XPWebViewController * webVC =[[XPWebViewController alloc] init]; + webVC.url = URLWithType(kGiftLevelURL); + [self.navigationController pushViewController:webVC animated:YES]; + +} +- (void)xPMineDataGiftHeadCell:(XPMineDataGiftHeadCell *)view didClickNormal:(UIButton *)sender{ + self.datasource = self.normalSource; + [self.collectionView reloadData]; +} +- (void)xPMineDataGiftHeadCell:(XPMineDataGiftHeadCell *)view didClickLucky:(UIButton *)sender{ + self.datasource = self.luckySource; + [self.collectionView reloadData]; } - #pragma mark - XPMineDataSkillCardTableViewCell -- (void)xPMineDataSkillCardTableViewCell:(XPMineDataSkillCardTableViewCell *)view didSelectItem:(MineSkillCardListInfoModel *)skillInfo { +- (void)xPMineDataSkillCardTableViewCell:(XPMineDataSkillCardCollectionViewCell *)view didSelectItem:(nullable MineSkillCardListInfoModel *)skillInfo { XPSkillCardViewController *skillCardVC = [[XPSkillCardViewController alloc] init]; skillCardVC.uid = self.userUid.integerValue; [self.navigationController pushViewController:skillCardVC animated:YES]; @@ -146,7 +168,7 @@ } - (UIScrollView *)listScrollView { - return self.tableView; + return self.collectionView; } - (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback { @@ -174,31 +196,34 @@ [self.delegate xPMineUserDataViewController:self didGetVoiceSuccess:voiceCard]; } self.skillArray = [array copy]; - [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; + [self.collectionView reloadData]; +// [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; } #pragma mark - Getters And Setters - (void)setUserInfo:(UserInfoModel *)userInfo { _userInfo = userInfo; - [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone]; + [self.collectionView reloadData]; +// [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone]; +} +- (UICollectionView *)collectionView{ + if(!_collectionView){ + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumInteritemSpacing = 5; + layout.minimumLineSpacing = 8; + + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.dataSource = self; + _collectionView.delegate = self; + _collectionView.backgroundColor = [UIColor whiteColor]; + [_collectionView registerClass:[XPMineDataSkillCardCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineDataSkillCardCollectionViewCell class])]; + [_collectionView registerClass:[XPMineDataGiftHeadCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineDataGiftHeadCell class])]; + [_collectionView registerClass:[XPMineUserInfoGiftWallCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoGiftWallCollectionViewCell class])]; + [_collectionView registerClass:[XPMineUserInfoEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoEmptyCollectionViewCell class])]; + } + return _collectionView; } -- (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:[XPMineDataSkillCardTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDataSkillCardTableViewCell class])]; - [_tableView registerClass:[XPMineDataGiftTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])]; - } - return _tableView; -} @end diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoEditViewController.m b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoEditViewController.m index 344b6502..98c2d503 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoEditViewController.m +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoEditViewController.m @@ -230,10 +230,8 @@ } #pragma mark - XPMineUserInfoNickViewControllerDelegate -- (void)xPMineUserInfoNickViewController:(XPMineUserInfoNickViewController *)viewController updateNick:(NSString *)nick { - if (nick.length > 0) { - [self.presenter complectionInfoWithAvatar:nil nick:nick birth:nil userDesc:nil]; - } +- (void)xPMineUserInfoNickViewController:(XPMineUserInfoNickViewController *)viewController updateUser:(UserInfoModel *)user { + [self completeUserInfoSuccess:user]; } #pragma mark - XPMineUserInfoDesViewControllerDelegate - (void)xPMineUserInfoDesViewController:(XPMineUserInfoDesViewController *)viewController updateUserDes:(NSString *)userDes { diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoNickViewController.h b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoNickViewController.h index 5ec889a4..7b1aba5c 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoNickViewController.h +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoNickViewController.h @@ -8,10 +8,10 @@ #import "BaseViewController.h" NS_ASSUME_NONNULL_BEGIN -@class XPMineUserInfoNickViewController; +@class XPMineUserInfoNickViewController,UserInfoModel; @protocol XPMineUserInfoNickViewControllerDelegate ///更新用户名 -- (void)xPMineUserInfoNickViewController:(XPMineUserInfoNickViewController *)viewController updateNick:(NSString *)nick; +- (void)xPMineUserInfoNickViewController:(XPMineUserInfoNickViewController *)viewController updateUser:(UserInfoModel *)user; @end @interface XPMineUserInfoNickViewController : BaseViewController diff --git a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoNickViewController.m b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoNickViewController.m index 3f4d3572..365683ab 100644 --- a/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoNickViewController.m +++ b/xplan-ios/Main/Mine/View/MineInfo/XPMineUserInfoNickViewController.m @@ -14,7 +14,8 @@ #import "UIImage+Utils.h" ///Tool #import "UserInfoModel.h" - +#import "Api+Mine.h" +#import "NSMutableDictionary+Saft.h" static NSInteger maxCount = 15; @interface XPMineUserInfoNickViewController () @@ -112,10 +113,32 @@ static NSInteger maxCount = 15; } #pragma mark - Event Response - (void)completionBtnAction:(UIButton *)sender { - [self.navigationController popViewControllerAnimated:YES]; - if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoNickViewController:updateNick:)]) { - [self.delegate xPMineUserInfoNickViewController:self updateNick:self.nickTextField.text]; - } + if(self.nickTextField.text.length == 0){ + [self showErrorToast:@"请输入昵称"]; + return; + } + [self showLoading]; + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * ticket = [[AccountInfoStorage instance] getTicket]; + NSMutableDictionary * dic = [NSMutableDictionary dictionary]; + [dic safeSetObject:self.nickTextField.text forKey:@"nick"]; + [dic safeSetObject:uid forKey:@"uid"]; + [dic safeSetObject:ticket forKey:@"ticket"]; + [Api completeUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + [self hideHUD]; + if (data.code == 200){ + [self.navigationController popViewControllerAnimated:YES]; + UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data]; + if(self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoNickViewController:updateUser:)]){ + [self.delegate xPMineUserInfoNickViewController:self updateUser:infoModel]; + } + return; + } + [self showErrorToast:msg]; + } userInfo:dic]; + + + } #pragma mark - getter && setter - (UIView *)containView { diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoGiftView.h b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoGiftView.h index 594b05a3..72dd8b61 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoGiftView.h +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoGiftView.h @@ -11,7 +11,8 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMineUserInfoGiftView : UIView -@property (nonatomic,strong) NSArray *datasource; +@property(nonatomic,copy) NSString *userId; +- (instancetype)initWithFrame:(CGRect)frame type:(NSString *)type; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoGiftView.m b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoGiftView.m index 4da03500..250854e5 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoGiftView.m +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoGiftView.m @@ -12,43 +12,60 @@ #import "XPMacro.h" #import "NSArray+Safe.h" ///View -#import "XPMineDataGiftCollectionViewCell.h" +#import "XPMineUserInfoGiftWallCollectionViewCell.h" #import "XPMineUserInfoEmptyCollectionViewCell.h" - +#import "Api+Mine.h" +#import "UserGiftWallInfoModel.h" @interface XPMineUserInfoGiftView () ///列表 @property (nonatomic,strong) UICollectionView *collectionView; +@property (nonatomic,strong) NSArray *datasource; + +@property(nonatomic,copy) NSString *type; @end @implementation XPMineUserInfoGiftView -- (instancetype)initWithFrame:(CGRect)frame { +- (instancetype)initWithFrame:(CGRect)frame type:(NSString *)type{ self = [super initWithFrame:frame]; if (self) { + + self.type = type; [self initSubViews]; [self initSubViewConstraints]; } return self; } - +-(void)setUserId:(NSString *)userId{ + _userId = userId; + [Api getUserGiftWall:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if(data.code == 200){ + NSArray * array= [UserGiftWallInfoModel modelsWithArray:data.data]; + NSMutableArray *a = [NSMutableArray arrayWithArray:array]; + NSMutableArray *b = [NSMutableArray arrayWithArray:a]; + self.datasource = [NSMutableArray arrayWithArray:b]; + [self.collectionView reloadData]; + } + } uid:_userId giftType:self.type]; +} #pragma mark - Private Method - (void)initSubViews { self.backgroundColor = [UIColor clearColor]; [self addSubview:self.collectionView]; + + } - (void)initSubViewConstraints { [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(20); - make.right.mas_equalTo(-20); + make.left.mas_equalTo(0); + make.right.mas_equalTo(0); make.top.bottom.mas_equalTo(0); }]; } #pragma mark - UICollectionViewDelegate And UICollectionViewDatasource - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { - CGFloat width = (CGRectGetWidth(collectionView.frame) - 16*3)/4.0; - CGFloat height = 82.0/72.0*width; - return self.datasource.count > 0? CGSizeMake(width, height) : collectionView.bounds.size; + return self.datasource.count > 0? CGSizeMake(84, 122) : collectionView.bounds.size; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { @@ -57,7 +74,7 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { if (self.datasource.count > 0) { - XPMineDataGiftCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineDataGiftCollectionViewCell class]) forIndexPath:indexPath]; + XPMineUserInfoGiftWallCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoGiftWallCollectionViewCell class]) forIndexPath:indexPath]; cell.giftInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; return cell; } @@ -71,24 +88,20 @@ return self; } -#pragma mark - Getters And Setters -- (void)setDatasource:(NSArray *)datasource { - _datasource = datasource; - [self.collectionView reloadData]; -} + + - (UICollectionView *)collectionView{ if (!_collectionView) { UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; - layout.minimumInteritemSpacing = 16; - layout.minimumLineSpacing = 14; -// layout.sectionInset = UIEdgeInsetsMake(0, 10, 0, 10); + layout.minimumInteritemSpacing = 5; + layout.minimumLineSpacing = 8; + layout.sectionInset = UIEdgeInsetsMake(0, 12, 0, 12); _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; _collectionView.dataSource = self; _collectionView.delegate = self; - _collectionView.scrollEnabled = NO; _collectionView.backgroundColor = [UIColor clearColor]; - [_collectionView registerClass:[XPMineDataGiftCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineDataGiftCollectionViewCell class])]; + [_collectionView registerClass:[XPMineUserInfoGiftWallCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoGiftWallCollectionViewCell class])]; [_collectionView registerClass:[XPMineUserInfoEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineUserInfoEmptyCollectionViewCell class])]; } diff --git a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index 84fe5b30..bd92d049 100644 --- a/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/xplan-ios/Main/Mine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -449,7 +449,7 @@ } self.idLabel.text = [NSString stringWithFormat:@"ID:%ld", (long)_userInfo.erbanNo]; self.copysIdImageView.hidden = NO; - self.signLabel.text = _userInfo.userDesc.length > 0 ? _userInfo.userDesc : @"我是个默认签名"; + self.signLabel.text = _userInfo.userDesc.length > 0 ? _userInfo.userDesc : @"他还没有写个人介绍~"; NSString *fansNum = [NSString stringWithFormat:@"%ld",_userInfo.fansNum]; diff --git a/xplan-ios/Main/Mine/View/XPMineViewController.m b/xplan-ios/Main/Mine/View/XPMineViewController.m index 5ef369fc..1908de38 100644 --- a/xplan-ios/Main/Mine/View/XPMineViewController.m +++ b/xplan-ios/Main/Mine/View/XPMineViewController.m @@ -202,15 +202,16 @@ case XPMineItemType_My_Room: { - if(self.userInfo.isCertified == NO){ - [self showRealNameAuthenticationTipsAlertView]; - return; - } + NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid]; [Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if (code == 200) { RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data]; if (roomInfo.isReselect) { + if(self.userInfo.isCertified == NO){ + [self showRealNameAuthenticationTipsAlertView:@"为了营造更安全的网络环境\n在 开通个人房间前\n需要先进行实名认证" isShowRoom:YES]; + return; + } XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init]; roomOpenView.roomInfo = roomInfo; roomOpenView.currentVC = self; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.m b/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.m index 4751d875..ede33feb 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.m @@ -22,7 +22,7 @@ /// @param complection 完成 /// @param roomUid 房间的roomuid + (void)requestNormalGiftList:(HttpRequestHelperCompletion)complection roomUid:(NSString *)roomUid { - [self makeRequest:@"gift/listV4" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil]; + [self makeRequest:@"gift/listV5" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil]; } /// 请求福袋全服礼物全服记录 diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.h b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.h index 4f4a1aec..8dc60df9 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.h @@ -8,7 +8,7 @@ #import #import "GiftNobleInfoModel.h" #import "XPWeekStarRankUserModel.h" - +#import "MewUnlockGiftModel.h" NS_ASSUME_NONNULL_BEGIN //礼物类型 typedef NS_ENUM(NSUInteger, GiftType) { @@ -21,6 +21,8 @@ typedef NS_ENUM(NSUInteger, GiftType) { GiftType_Anchor = 11, //个播礼物 GiftType_Punish = 12, //惩罚礼物 GiftType_Twelve_Star = 13, //星座礼物 + GiftType_Unlock = 16, //解锁礼物 + GiftType_DressUp = 17, //解锁礼物 }; //礼物类型 @@ -115,6 +117,14 @@ typedef NS_ENUM(NSUInteger, RoomSendGiftType) { @property (nonatomic, strong) XPWeekStarRankUserModel *firstCharmRankUser; ///上周对应礼物豪气榜第一 @property (nonatomic, strong) XPWeekStarRankUserModel *firstLevelRankUser; +@property(nonatomic,strong) MewUnlockBaseGiftModel *baseGift;/// 解锁基础礼物 +@property(nonatomic,assign) BOOL unlocked;///是否解锁 +@property(nonatomic,copy) NSArray * unlockGiftList; +@property(nonatomic,copy) NSString *giftTag;///礼物标签 +@property(nonatomic,copy) NSString *bannerUrl; + +@property(nonatomic,copy) NSString *bannerSkipUrl; + @end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.m b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.m index b18e4928..7732e387 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.m @@ -9,4 +9,10 @@ #import "MJExtension.h" @implementation GiftInfoModel MJCodingImplementation + ++ (NSDictionary *)objectClassInArray { + return @{@"unlockGiftList":MewUnlockGiftModel.class + }; +} + @end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftReceiveInfoModel.h b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftReceiveInfoModel.h index c7a9f1a4..3ec6fc2e 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftReceiveInfoModel.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftReceiveInfoModel.h @@ -88,6 +88,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,assign) BOOL isBatch; ///播放哪个动画 @property (nonatomic, assign) BOOL isShowAnimation; + + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockBaseGiftModel.h b/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockBaseGiftModel.h new file mode 100644 index 00000000..b38fa2ed --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockBaseGiftModel.h @@ -0,0 +1,30 @@ +// +// MewUnlockBaseGiftModel.h +// xplan-ios +// +// Created by duoban on 2024/1/26. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MewUnlockBaseGiftModel : NSObject +@property(nonatomic,copy) NSString *uid; +@property(nonatomic,copy) NSString *nick; +///礼物id +@property (nonatomic, assign)NSInteger giftId; +///礼物名字 +@property (nonatomic, strong)NSString *giftName; +///价格 +@property (nonatomic, assign)double goldPrice; +///礼物url +@property (nonatomic, copy)NSString *giftUrl; + +@property(nonatomic,assign) CGFloat width; +@property(nonatomic,assign) BOOL isSelect; +@property(nonatomic,copy) NSString *dressName; +@property(nonatomic,copy) NSString *dressUrl; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockBaseGiftModel.m b/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockBaseGiftModel.m new file mode 100644 index 00000000..c5f329dc --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockBaseGiftModel.m @@ -0,0 +1,12 @@ +// +// MewUnlockBaseGiftModel.m +// xplan-ios +// +// Created by duoban on 2024/1/26. +// + +#import "MewUnlockBaseGiftModel.h" + +@implementation MewUnlockBaseGiftModel + +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockGiftModel.h b/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockGiftModel.h new file mode 100644 index 00000000..c79cc1f0 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockGiftModel.h @@ -0,0 +1,22 @@ +// +// MewUnlockGiftModel.h +// xplan-ios +// +// Created by duoban on 2024/1/26. +// + +#import +#import "MewUnlockBaseGiftModel.h" +NS_ASSUME_NONNULL_BEGIN + +@interface MewUnlockGiftModel : NSObject + +@property(nonatomic,assign) int condition; +@property(nonatomic,assign) int process; +@property(nonatomic,strong) MewUnlockBaseGiftModel *targetGift; +@property(nonatomic,assign) BOOL unlocked; +@property(nonatomic,assign) CGFloat width; +@property(nonatomic,assign) BOOL isSelect; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockGiftModel.m b/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockGiftModel.m new file mode 100644 index 00000000..e9123691 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/MewUnlockGiftModel.m @@ -0,0 +1,12 @@ +// +// MewUnlockGiftModel.m +// xplan-ios +// +// Created by duoban on 2024/1/26. +// + +#import "MewUnlockGiftModel.h" + +@implementation MewUnlockGiftModel + +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m b/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m index ca9d9f4d..96287ac2 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m @@ -60,7 +60,7 @@ } [Api requestNormalGiftList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - NSArray *luckyBagGift = [GiftInfoModel modelsWithArray:data.data[@"luckyBagGift"]]; // 福袋礼物 + NSArray *luckyBagGift = [GiftInfoModel modelsWithArray:data.data[@"interestGift"]]; // 福袋礼物 NSArray *vipGift = [GiftInfoModel modelsWithArray:data.data[@"vipGift"]]; // 贵族礼物 NSArray *luckyPoolGift = [GiftInfoModel modelsWithArray:data.data[@"luckyPoolGift"]];// 福袋奖池礼物 NSArray *normalGift = [GiftInfoModel modelsWithArray:data.data[@"normalGift"]]; // 普通面板礼物 diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m index ad383094..4419a904 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m @@ -44,6 +44,8 @@ ///贵族礼物锁 @property (nonatomic, strong) UIImageView *lockImageView; +@property(nonatomic,strong) NetImageView *tagImageView; + @end @implementation XPGiftItemCollectionViewCell @@ -67,7 +69,8 @@ [self.contentView addSubview:self.giftNumLabel]; [self.contentView addSubview:self.nobleIconImageView]; [self.contentView addSubview:self.lockImageView]; - + [self.contentView addSubview:self.tagImageView]; + [self.tagStackView addArrangedSubview:self.exclusiveImageView]; [self.tagStackView addArrangedSubview:self.giftNewImageView]; [self.tagStackView addArrangedSubview:self.limitImageView]; @@ -79,6 +82,7 @@ } - (void)initSubViewConstraints { + [self.tagStackView mas_makeConstraints:^(MASConstraintMaker *make) { make.right.top.mas_equalTo(self.contentView).inset(3); make.height.mas_equalTo(14); @@ -121,11 +125,31 @@ make.centerY.mas_equalTo(self.tagStackView); }]; [self.lockImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.bottom.mas_equalTo(self.contentView).mas_offset(-4); - make.width.height.mas_equalTo(16); + make.left.mas_equalTo(18); + make.top.mas_equalTo(7); + make.width.height.mas_equalTo(9); }]; + [self.tagImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(18); + make.top.mas_equalTo(47); + make.height.mas_equalTo(12); + make.width.mas_equalTo(29); + }]; + +} +-(void)setVeiwLucency:(CGFloat)alpha{ + self.giftImageView.alpha = alpha; + self.giftNameLabel.alpha = alpha; + self.giftNumLabel.alpha = alpha; + self.nobleIconImageView.alpha = alpha; + self.tagImageView.alpha = alpha; + self.exclusiveImageView.alpha = alpha; + self.giftNewImageView.alpha = alpha; + self.limitImageView.alpha = alpha; + self.specialImageView.alpha = alpha; + self.priceLabel.alpha = alpha; + self.logoImageView.alpha = alpha; } - - (UIImageView *)createImageView:(NSString *)imageName { UIImageView * imageView = [[UIImageView alloc] init]; imageView.userInteractionEnabled = YES; @@ -138,6 +162,17 @@ _giftInfo = giftInfo; if (_giftInfo) { self.giftImageView.imageUrl = giftInfo.giftUrl; + self.tagImageView.image = nil; + [self.tagImageView loadImageWithUrl:giftInfo.giftTag completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + CGFloat height = image.size.height > 0 ? image.size.height : 1; + CGFloat width = image.size.width * 12 / height; + [self.tagImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(18); + make.top.mas_equalTo(47); + make.height.mas_equalTo(12); + make.width.mas_equalTo(width); + }]; + }]; self.giftNameLabel.text = _giftInfo.giftName.length > 0 ? _giftInfo.giftName : @""; self.coverView.hidden = !giftInfo.isSelected; NSString *strr = [NSString stringWithFormat:@"%ld",(long)_giftInfo.goldPrice]; @@ -169,12 +204,28 @@ self.coverView.layer.masksToBounds = YES; self.coverView.layer.cornerRadius = 0; } - + [self setVeiwLucency:1]; if (giftInfo.giftType == GiftType_Noble && giftInfo.giftVipInfo) { self.nobleIconImageView.hidden = NO; self.nobleIconImageView.imageUrl = giftInfo.giftVipInfo.vipIcon; self.lockImageView.hidden = self.curUserNobleLevel >= giftInfo.giftVipInfo.vipLevel; - } else { + [self setVeiwLucency:!self.lockImageView.hidden ? 0.5 : 1]; + }else if(giftInfo.giftType == GiftType_Unlock){ + for (int i = 0 ; i < giftInfo.unlockGiftList.count; i++) { + MewUnlockGiftModel *model = giftInfo.unlockGiftList[i]; + if (model.targetGift.giftId == giftInfo.giftId){ + if (model.process < model.condition){ + self.lockImageView.hidden = NO; + [self setVeiwLucency:0.5]; + model.unlocked = NO; + }else{ + self.lockImageView.hidden = YES; + [self setVeiwLucency:1]; + model.unlocked = YES; + } + } + } + }else { self.nobleIconImageView.hidden = YES; self.lockImageView.hidden = YES; } @@ -308,5 +359,10 @@ } return _lockImageView; } - +- (NetImageView *)tagImageView{ + if(!_tagImageView){ + _tagImageView = [NetImageView new]; + } + return _tagImageView; +} @end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.h new file mode 100644 index 00000000..424c8385 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.h @@ -0,0 +1,28 @@ +// +// MewUnlockGiftBroadcastView.h +// xplan-ios +// +// Created by duoban on 2024/1/26. +// + +#import +#import "GiftInfoModel.h" +@class MewUnlockGiftModel; +NS_ASSUME_NONNULL_BEGIN + +@protocol MewUnlockGiftBroadcastViewDelegate + +-(void)mewUnlockGiftBroadcastViewDidChooseUnlockGift:(MewUnlockGiftModel * _Nullable)giftModel; +-(void)mewUnlockGiftBroadcastViewDidChooseDressUpGift:(GiftInfoModel *_Nullable)giftModel; +@end + + +@interface MewUnlockGiftBroadcastView : UIView +@property(nonatomic,strong)GiftInfoModel *giftModel;/// 解锁基础礼物 +@property(nonatomic,weak) iddelegate; +@property(nonatomic,assign) BOOL isDressUpGift; +-(void)updateGiftInfo:(GiftInfoModel *)giftModel count:(int)count; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.m new file mode 100644 index 00000000..9962e276 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastView.m @@ -0,0 +1,188 @@ +// +// MewUnlockGiftBroadcastView.m +// xplan-ios +// +// Created by duoban on 2024/1/26. +// + +#import "MewUnlockGiftBroadcastView.h" +#import "MewUnlockGiftBroadcastViewCell.h" +@interface MewUnlockGiftBroadcastView() +@property(nonatomic,strong) UICollectionView *collectionView; +@property(nonatomic,strong) NetImageView *dressUpView; +@end +@implementation MewUnlockGiftBroadcastView + +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + self.backgroundColor = UIColorRGBAlpha(0x0A0A0A , 1); + self.layer.cornerRadius = 10; + self.layer.masksToBounds = YES; + [self addSubview:self.collectionView]; + [self addSubview:self.dressUpView]; +} +-(void)installConstraints{ + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + [self.dressUpView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; +} +-(void)setGiftModel:(GiftInfoModel *)giftModel{ + _giftModel = giftModel; + self.dressUpView.image = nil; + if (_giftModel.bannerUrl.length > 0){ + [self.dressUpView loadImageWithUrl:_giftModel.bannerUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + self.dressUpView.image = image; + }]; + } + + [self.collectionView reloadData]; + if(_giftModel.baseGift.isSelect == YES){ + dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)); + dispatch_after(delayTime, dispatch_get_main_queue(), ^{ + self.collectionView.contentOffset = CGPointMake(0, 0); + }); + }else{ + CGFloat x = self.giftModel.baseGift.width + 6; + for (int i = 0; i < _giftModel.unlockGiftList.count ; i++) { + + MewUnlockGiftModel *model = self.giftModel.unlockGiftList[i]; + if (model.isSelect){ + if (i > 0){ + x = x + model.width + 6; + } + + } + + } + dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)); + dispatch_after(delayTime, dispatch_get_main_queue(), ^{ + self.collectionView.contentOffset = CGPointMake(x, 0); + }); + } + +} +-(void)setIsDressUpGift:(BOOL)isDressUpGift{ + _isDressUpGift = isDressUpGift; + _dressUpView.hidden = !_isDressUpGift; +} +#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return self.giftModel.unlockGiftList.count + 1; +} +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.row == 0){ + return CGSizeMake(self.giftModel.baseGift.width, 32); + } + MewUnlockGiftModel *model = self.giftModel.unlockGiftList[indexPath.row - 1]; + return CGSizeMake(model.width, 32); + +} +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + MewUnlockGiftBroadcastViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewUnlockGiftBroadcastViewCell class]) forIndexPath:indexPath]; + cell.isBaseGift = indexPath.row == 0; + cell.baseModel = self.giftModel.baseGift; + if (indexPath.row > 0){ + cell.unlockModel = [self.giftModel.unlockGiftList safeObjectAtIndex1:indexPath.row - 1]; + } + cell.path = indexPath; + cell.delegate = self; + + return cell; +} +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ + + for (int i = 0 ; i < self.giftModel.unlockGiftList.count; i++) { + MewUnlockGiftModel *model = self.giftModel.unlockGiftList[i]; + if (indexPath.row == 0){ + model.isSelect = NO; + self.giftModel.baseGift.isSelect = YES; + }else{ + model.isSelect = i == indexPath.row-1; + self.giftModel.baseGift.isSelect = NO; + } + + } + if (indexPath.row == 0){ + MewUnlockGiftModel *model = [MewUnlockGiftModel new]; + model.targetGift = self.giftModel.baseGift; + if (self.delegate && [self.delegate respondsToSelector:@selector(mewUnlockGiftBroadcastViewDidChooseUnlockGift:)]){ + [self.delegate mewUnlockGiftBroadcastViewDidChooseUnlockGift:model]; + } + }else{ + if (self.delegate && [self.delegate respondsToSelector:@selector(mewUnlockGiftBroadcastViewDidChooseUnlockGift:)]){ + [self.delegate mewUnlockGiftBroadcastViewDidChooseUnlockGift:self.giftModel.unlockGiftList[indexPath.row-1]]; + } + } + + [self.collectionView reloadData]; +} +-(void)updateGiftInfo:(GiftInfoModel *)giftModel count:(int)count{ +// MewUnlockGiftModel *model1 = self.giftModel.unlockGiftList[2]; +// if (giftModel.giftId == self.giftModel.baseGift.giftId){ +// for (int i = 0 ; i < self.giftModel.unlockGiftList.count; i++) { +// MewUnlockGiftModel *model = self.giftModel.unlockGiftList[i]; +// int num = model.condition - model.process; +// if (count > num){ +// model.process = model.condition; +// count = count - num; +// }else{ +// model.process = model.process + count; +// } +// +// } +// } +// MewUnlockGiftModel *model2 = self.giftModel.unlockGiftList[2]; + [self.collectionView reloadData]; +} +#pragma mark - MewUnlockGiftBroadcastViewCellDelegate +- (void)didSelectItemAtIndexPath:(NSIndexPath *)path{ + [self.collectionView scrollToItemAtIndexPath:path atScrollPosition:UICollectionViewScrollPositionNone animated:YES]; + +} +-(void)clickDressUpGiftAction{ + if(self.delegate && [self.delegate respondsToSelector:@selector(mewUnlockGiftBroadcastViewDidChooseDressUpGift:)]){ + [self.delegate mewUnlockGiftBroadcastViewDidChooseDressUpGift:self.giftModel]; + } +} +#pragma mark - 懒加载 +- (UICollectionView *)collectionView{ + if(!_collectionView){ + UICollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new]; + layout.minimumLineSpacing = 0; + layout.minimumInteritemSpacing = 4; + layout.sectionInset = UIEdgeInsetsMake(0, 6, 0, 6); + + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + + _collectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.delegate = self; + _collectionView.dataSource = self; + _collectionView.showsVerticalScrollIndicator = NO; + _collectionView.showsHorizontalScrollIndicator = NO; + _collectionView.backgroundColor = [UIColor clearColor]; + [_collectionView registerClass:[MewUnlockGiftBroadcastViewCell class] forCellWithReuseIdentifier:NSStringFromClass([MewUnlockGiftBroadcastViewCell class])]; + } + return _collectionView; +} +- (NetImageView *)dressUpView{ + if(!_dressUpView){ + + _dressUpView = [[NetImageView alloc]init]; + _dressUpView.hidden = YES; + _dressUpView.userInteractionEnabled = YES; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickDressUpGiftAction)]; + [_dressUpView addGestureRecognizer:tap]; + } + return _dressUpView; +} +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.h new file mode 100644 index 00000000..4deee2d9 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.h @@ -0,0 +1,29 @@ +// +// MewUnlockGiftBroadcastViewCell.h +// xplan-ios +// +// Created by duoban on 2024/1/26. +// + +#import +#import "MewUnlockBaseGiftModel.h" +#import "MewUnlockGiftModel.h" + + +@protocol MewUnlockGiftBroadcastViewCellDelegate + +-(void)didSelectItemAtIndexPath:(NSIndexPath *_Nullable)path; + +@end + +NS_ASSUME_NONNULL_BEGIN + +@interface MewUnlockGiftBroadcastViewCell : UICollectionViewCell +@property(nonatomic,assign) BOOL isBaseGift; +@property(nonatomic,strong) MewUnlockBaseGiftModel *baseModel; +@property(nonatomic,strong) MewUnlockGiftModel *unlockModel; +@property(nonatomic,strong) NSIndexPath *path; +@property(nonatomic,weak) iddelegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.m new file mode 100644 index 00000000..403a9419 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/MewUnlockGiftBroadcastViewCell.m @@ -0,0 +1,250 @@ +// +// MewUnlockGiftBroadcastViewCell.m +// xplan-ios +// +// Created by duoban on 2024/1/26. +// + +#import "MewUnlockGiftBroadcastViewCell.h" +@interface MewUnlockGiftBroadcastViewCell() +@property(nonatomic,strong) NetImageView *giftImageView; +@property(nonatomic,strong) UILabel *giftNameView; +@property(nonatomic,strong) UILabel *giftPriceView; +@property(nonatomic,strong) UIImageView *unlockIconView; +@property(nonatomic,strong) NetImageView *unlockGiftImageView; +@property(nonatomic,strong) UILabel *unlockTitleView; +@property(nonatomic,strong) UILabel *unlockNumView; +@property(nonatomic,strong) UIView *unlockBgView; +@property(nonatomic,strong) UIView *unlockProgressView; +@end +@implementation MewUnlockGiftBroadcastViewCell +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + self.contentView.layer.cornerRadius = 4; + self.contentView.layer.masksToBounds = YES; + self.contentView.layer.borderColor = UIColorRGBAlpha(0xFFDA24, 1).CGColor; + self.contentView.layer.borderWidth = 0; + self.contentView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.08]; + [self.contentView addSubview:self.giftImageView]; + [self.contentView addSubview:self.giftNameView]; + [self.contentView addSubview:self.giftPriceView]; + + + [self.contentView addSubview:self.unlockGiftImageView]; + [self.contentView addSubview:self.unlockTitleView]; + [self.contentView addSubview:self.unlockBgView]; + [self.unlockBgView addSubview:self.unlockProgressView]; + [self.contentView addSubview:self.unlockNumView]; + [self.contentView addSubview:self.unlockIconView]; + + +} +-(void)setIsBaseGift:(BOOL)isBaseGift{ + _isBaseGift = isBaseGift; + self.giftImageView.hidden = !isBaseGift; + self.giftNameView.hidden = !isBaseGift; + self.giftPriceView.hidden = !isBaseGift; + + self.unlockGiftImageView.hidden = isBaseGift; + self.unlockTitleView.hidden = isBaseGift; + self.unlockBgView.hidden = isBaseGift; + self.unlockNumView.hidden = isBaseGift; + self.unlockIconView.hidden = isBaseGift; +} +-(void)installConstraints{ + [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(3); + make.centerY.equalTo(self.contentView); + make.width.height.mas_equalTo(28); + }]; + [self.giftNameView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(33); + make.top.mas_equalTo(3); + make.height.mas_equalTo(14); + }]; + [self.giftPriceView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(14); + make.left.mas_equalTo(33); + make.height.mas_equalTo(13); + }]; + [self.unlockIconView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(8); + make.left.mas_equalTo(3); + make.top.mas_equalTo(2); + }]; + [self.unlockGiftImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(28); + make.left.mas_equalTo(3); + make.centerY.equalTo(self.contentView); + }]; + [self.unlockTitleView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(33); + make.top.mas_equalTo(3); + make.height.mas_equalTo(14); + }]; + [self.unlockNumView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.unlockTitleView.mas_right).mas_offset(3); + make.height.mas_equalTo(13); + make.width.mas_greaterThanOrEqualTo(10); + make.top.mas_equalTo(17); + + }]; + [self.unlockBgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(33); + make.right.equalTo(self.unlockNumView.mas_left).mas_offset(-2); + make.height.mas_equalTo(6); + make.centerY.equalTo(self.unlockNumView); + }]; + [self.unlockProgressView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.bottom.equalTo(self.unlockBgView); + make.width.mas_equalTo(0); + }]; +} +-(void)setBaseModel:(MewUnlockBaseGiftModel *)baseModel{ + _baseModel = baseModel; + UIFont *font = [UIFont systemFontOfSize:9 weight:UIFontWeightRegular]; + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:@(_baseModel.goldPrice).stringValue attributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:UIColorFromRGB(0xCED1DB)}]; + UIImage *iconImage = kImage(@"gift_diamond"); + NSTextAttachment * attachment = [[NSTextAttachment alloc] init]; + attachment.bounds = CGRectMake(0, roundf(font.capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height);; + attachment.image = iconImage; + [textAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:attachment] atIndex:0]; + _giftPriceView.attributedText = textAtt; + _giftImageView.image = nil; + [_giftImageView loadImageWithUrl:_baseModel.giftUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + self.giftImageView.image = image; + }]; + _giftNameView.text = _baseModel.giftName; + self.contentView.layer.borderWidth = _baseModel.isSelect ? 1 : 0; +} + +- (void)setUnlockModel:(MewUnlockGiftModel *)unlockModel{ + _unlockModel = unlockModel; + _unlockGiftImageView.image = nil; + [_unlockGiftImageView loadImageWithUrl:_unlockModel.targetGift.giftUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + self.unlockGiftImageView.image = image; + }]; + NSString *text = [NSString stringWithFormat:@"送出 %d个 %@可解锁",_unlockModel.condition,_baseModel.giftName]; + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:text attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:10 weight:UIFontWeightRegular],NSForegroundColorAttributeName:[UIColor whiteColor]}]; + [textAtt addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xFFDA24),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} range:[text rangeOfString:[NSString stringWithFormat:@"%d个",_unlockModel.condition]]]; + _unlockTitleView.attributedText = textAtt; + + NSMutableAttributedString *numAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%d/%d",_unlockModel.process,_unlockModel.condition] attributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xCED1DB),NSFontAttributeName:[UIFont systemFontOfSize:9 weight:UIFontWeightRegular]}]; + _unlockNumView.attributedText = numAtt; + if(_unlockModel.condition > 0){ + + CGFloat value = _unlockModel.process / (CGFloat)_unlockModel.condition; + + [self.unlockProgressView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.left.top.bottom.equalTo(self.unlockBgView); + make.width.equalTo(self.unlockBgView).multipliedBy(value); + }]; + + } + [self setVeiwLucency:1]; + if (_unlockModel.process < _unlockModel.condition){ + _unlockIconView.hidden = NO; + [self setVeiwLucency:0.5]; + self.contentView.layer.borderColor = UIColorRGBAlpha(0xFFDA24, 0.5).CGColor ; + }else{ + _unlockIconView.hidden = YES; + self.contentView.layer.borderColor = UIColorRGBAlpha(0xFFDA24, 1).CGColor ; + } + if (!_baseModel.isSelect){ + self.contentView.layer.borderWidth = _unlockModel.isSelect ? 1 : 0; + }else{ + self.contentView.layer.borderWidth = 0; + } + +} +-(void)setVeiwLucency:(CGFloat)alpha{ + + + self.unlockGiftImageView.alpha = alpha; + self.unlockTitleView.alpha = alpha; + self.unlockBgView.alpha = alpha; + self.unlockNumView.alpha = alpha; + self.unlockProgressView.alpha = alpha; +} +#pragma mark - 懒加载 +- (NetImageView *)giftImageView{ + if(!_giftImageView){ + _giftImageView = [NetImageView new]; + } + return _giftImageView; +} +- (UILabel *)giftNameView{ + if(!_giftNameView){ + _giftNameView = [UILabel labelInitWithText:@"甜心草莓" font:[UIFont systemFontOfSize:10 weight:UIFontWeightRegular] textColor:[UIColor whiteColor]]; + } + return _giftNameView; +} +- (UILabel *)giftPriceView{ + if(!_giftPriceView){ + _giftPriceView = [UILabel new]; + UIFont *font = [UIFont systemFontOfSize:9 weight:UIFontWeightRegular]; + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:@"0" attributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:UIColorFromRGB(0xCED1DB)}]; + UIImage *iconImage = kImage(@"gift_diamond"); + NSTextAttachment * attachment = [[NSTextAttachment alloc] init]; + attachment.bounds = CGRectMake(0, roundf(font.capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height);; + attachment.image = iconImage; + [textAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:attachment] atIndex:0]; + _giftPriceView.attributedText = textAtt; + } + return _giftPriceView; +} +- (UIImageView *)unlockIconView{ + if(!_unlockIconView){ + _unlockIconView = [UIImageView new]; + _unlockIconView.image = kImage(@"room_gift_noble_lock"); + } + return _unlockIconView; +} +- (NetImageView *)unlockGiftImageView{ + if(!_unlockGiftImageView){ + _unlockGiftImageView = [NetImageView new]; + } + return _unlockGiftImageView; +} +-(UILabel *)unlockTitleView{ + if(!_unlockTitleView){ + _unlockTitleView = [UILabel new]; + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:@"送出 5个 甜心草莓可解锁" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:10 weight:UIFontWeightRegular],NSForegroundColorAttributeName:[UIColor whiteColor]}]; + [textAtt addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xFFDA24),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} range:[@"送出 5个 甜心草莓可解锁" rangeOfString:@"5个"]]; + _unlockTitleView.attributedText = textAtt; + } + return _unlockTitleView; +} +- (UIView *)unlockBgView{ + if(!_unlockBgView){ + _unlockBgView = [UIView new]; + _unlockBgView.backgroundColor = UIColorFromRGB(0x696D7A); + _unlockBgView.layer.cornerRadius = 3; + _unlockBgView.layer.masksToBounds = YES; + } + return _unlockBgView; +} +- (UIView *)unlockProgressView{ + if(!_unlockProgressView){ + _unlockProgressView = [UIView new]; + _unlockProgressView.backgroundColor = UIColorFromRGB(0xFFDA24); + } + return _unlockProgressView; +} +- (UILabel *)unlockNumView{ + if(!_unlockNumView){ + _unlockNumView = [UILabel new]; + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:@"0/0" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:9 weight:UIFontWeightRegular],NSForegroundColorAttributeName:[UIColor whiteColor]}]; + [textAtt addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xFFDA24),NSFontAttributeName:[UIFont systemFontOfSize:9 weight:UIFontWeightRegular]} range:[@"0/0" rangeOfString:@"0"]]; + _unlockNumView.attributedText = textAtt; + } + return _unlockNumView; +} +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h index 601827f7..d4987553 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h @@ -9,6 +9,7 @@ #import "XPSendGiftView.h" ///Model #import "RoomInfoModel.h" +#import "MewUnlockGiftModel.h" #import "XPPrivilegeCardItemModel.h" NS_ASSUME_NONNULL_BEGIN @@ -64,10 +65,12 @@ typedef NS_ENUM(NSInteger, GiftSegmentType) { @property (nonatomic,assign) RoomType roomType; ///房间数据 @property(nonatomic,strong) RoomInfoModel *roomInfo; +///解锁礼物 +@property(nonatomic,strong) MewUnlockGiftModel *unlockGiftModel; ///头部礼物类型变更 /// - Parameter headType: 1:礼物 2:互动 - (void)giftHeadTypeHadChange:(NSInteger)headType; - +-(void)updateGiftInfo:(GiftInfoModel *)giftModel count:(int)count; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m index dd228bb0..e3f82df7 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m @@ -38,6 +38,8 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc @property (nonatomic,strong) UIButton *packGiftButton; ///幸运礼物 @property (nonatomic,strong) UIButton *luckyGiftButton; +@property(nonatomic,strong) UILabel *spiceTipsView; + ///贵族礼物 @property (nonatomic,strong) UIButton *nobleGiftButton; ///周星礼物 @@ -121,6 +123,14 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc self.privilegeBtton.selected = NO; sender.selected = !sender.selected; self.segmentType = sender.tag; + if(sender == self.luckyGiftButton){ + self.spiceTipsView.hidden = YES; + NSString *isHaveTips = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsHaveSpiceGiftTips"]; + if(isHaveTips == nil){ + [[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"kIsHaveSpiceGiftTips"]; + [[NSUserDefaults standardUserDefaults]synchronize]; + } + } } #pragma mark - Public Method @@ -140,8 +150,9 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc [self.freshIconImage removeFromSuperview]; self.freshIconImage = nil; [self.segmentStackView addArrangedSubview:self.normalGiftButton]; - [self.segmentStackView addArrangedSubview:self.nobleGiftButton]; [self.segmentStackView addArrangedSubview:self.luckyGiftButton]; + [self.segmentStackView addArrangedSubview:self.nobleGiftButton]; + [self.segmentStackView addArrangedSubview:self.weekStarButton]; [self.segmentStackView addArrangedSubview:self.privilegeBtton]; @@ -187,8 +198,8 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc [self.scrollView addSubview:self.segmentStackView]; ///分段控制 [self.segmentStackView addArrangedSubview:self.normalGiftButton]; - [self.segmentStackView addArrangedSubview:self.nobleGiftButton]; [self.segmentStackView addArrangedSubview:self.luckyGiftButton]; + [self.segmentStackView addArrangedSubview:self.nobleGiftButton]; [self.segmentStackView addArrangedSubview:self.weekStarButton]; [self.segmentStackView addArrangedSubview:self.privilegeBtton]; [self.segmentStackView addArrangedSubview:self.anchorButton]; @@ -196,6 +207,9 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc ///礼物 [self.giftStackView addArrangedSubview:self.giftcollectionView]; + + [self.luckyGiftButton addSubview:self.spiceTipsView]; + // [self.giftStackView addArrangedSubview:self.pageController]; } @@ -232,6 +246,19 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc // [self.pageController mas_makeConstraints:^(MASConstraintMaker *make) { // make.height.mas_equalTo(10); // }]; + [self.spiceTipsView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(24); + make.height.mas_equalTo(12); + make.centerX.equalTo(self.luckyGiftButton.mas_right).mas_offset(-5); + make.top.mas_equalTo(1); + + + }]; + + NSString *isHaveTips = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsHaveSpiceGiftTips"]; + if (isHaveTips == nil){ + self.spiceTipsView.hidden = NO; + } } - (void)resetSelectPrivilege:(NSArray *)array { for (XPPrivilegeCardItemModel * gift in array) { @@ -417,6 +444,7 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickItem:type:)]) { [self.delegate xPGiftInfoView:self didClickItem:giftInfo type:self.segmentType]; } + } } @@ -443,7 +471,45 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc _roomInfo = roomInfo; } - +- (void)setUnlockGiftModel:(MewUnlockGiftModel *)unlockGiftModel{ + _unlockGiftModel = unlockGiftModel; + NSInteger item = 0; + for (GiftInfoModel *model in self.datasource) { + if (model.giftId == unlockGiftModel.targetGift.giftId){ + item = [self.datasource indexOfObject:model]; + break; + } + } + if (self.datasource.count > 0) { + [self resetSelectGift:self.datasource]; + GiftInfoModel * giftInfo = [self.datasource safeObjectAtIndex1:item]; + [self dealSelectGift:giftInfo]; + [self.giftcollectionView reloadData]; + if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickItem:type:)]) { + [self.delegate xPGiftInfoView:self didClickItem:giftInfo type:self.segmentType]; + } + + } +} +-(void)updateGiftInfo:(GiftInfoModel *)giftModel count:(int)count{ + for (GiftInfoModel *obj in self.datasource) { + if (obj.baseGift.giftId == giftModel.giftId){ + for (int i = 0 ; i < obj.unlockGiftList.count; i++) { + MewUnlockGiftModel *model = obj.unlockGiftList[i]; + + int num = model.condition - model.process; + if (count > num){ + model.process = model.condition; + count = count - num; + }else{ + model.process = model.process + count; + } + } + + } + } + [self.giftcollectionView reloadData]; +} - (void)setSegmentType:(GiftSegmentType)segmentType { if (segmentType == _segmentType) { return; @@ -583,7 +649,7 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc NSMutableArray * anchor = [NSMutableArray array]; NSMutableArray * punishArray = [NSMutableArray array]; [_normalOriginArray enumerateObjectsUsingBlock:^(GiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - if (obj.giftType == GiftType_Lucky) { + if (obj.giftType == GiftType_Lucky || obj.giftType == GiftType_Unlock || obj.giftType == GiftType_DressUp) { [luckyArray addObject:obj]; } else if(obj.giftType == GiftType_Game) { [normaleArray addObject:obj]; @@ -777,7 +843,7 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc - (UIButton *)luckyGiftButton { if (!_luckyGiftButton) { _luckyGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_luckyGiftButton setTitle:@"幸运" forState:UIControlStateNormal]; + [_luckyGiftButton setTitle:@"趣味" forState:UIControlStateNormal]; [_luckyGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_luckyGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; _luckyGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; @@ -787,7 +853,17 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc } return _luckyGiftButton; } - +- (UILabel *)spiceTipsView{ + if(!_spiceTipsView){ + _spiceTipsView = [UILabel labelInitWithText:@"New" font:[UIFont systemFontOfSize:8 weight:UIFontWeightMedium] textColor:[UIColor whiteColor]]; + _spiceTipsView.textAlignment = NSTextAlignmentCenter; + _spiceTipsView.hidden = YES; + _spiceTipsView.layer.cornerRadius = 12/2; + _spiceTipsView.layer.masksToBounds = YES; + _spiceTipsView.backgroundColor = UIColorFromRGB(0xFF425B); + } + return _spiceTipsView; +} - (UIButton *)nobleGiftButton { if (!_nobleGiftButton) { _nobleGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m index 660bc384..a4899512 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m @@ -46,8 +46,8 @@ #import "XPWebViewController.h" #import "XPFirstRechargeViewController.h" #import "XPNobleCenterViewController.h" - -@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate> +#import "MewUnlockGiftBroadcastView.h" +@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate,MewUnlockGiftBroadcastViewDelegate> ///顶部的区域 @property (nonatomic,strong) UIView * topView; ///内容区域 @@ -58,6 +58,8 @@ @property (nonatomic,strong) UIStackView *stackView; ///幸运礼物广播 @property (nonatomic, strong) XPGiftLuckyGiftBroadcastView *luckyBroadcastView; +@property(nonatomic,strong) MewUnlockGiftBroadcastView *unlockGiftView; + ///星座礼物广播 @property (nonatomic, strong) XPGiftTwelveStarBroadcastView *constellationBanner; ///礼物类型(普通/互动) @@ -94,282 +96,283 @@ @implementation XPSendGiftView - (XPGiftPresenter *)createPresenter { - return [[XPGiftPresenter alloc] init]; + return [[XPGiftPresenter alloc] init]; } - (instancetype)initWithType:(SendGiftType)type uid:(NSString * __nullable)uid{ - if (self = [super init]) { - self.modalPresentationStyle = UIModalPresentationOverFullScreen; - self.roomUid = uid; - self.usingplaceType = type; - } - return self; + if (self = [super init]) { + self.modalPresentationStyle = UIModalPresentationOverFullScreen; + self.roomUid = uid; + self.usingplaceType = type; + } + return self; } - (void)viewDidLoad { - [self initSubViews]; - [self initSubViewConstraints]; - [self initHttpRequest]; + [self initSubViews]; + [self initSubViewConstraints]; + [self initHttpRequest]; } #pragma mark - Private Method - (void)initSubViews { - [self.view addSubview:self.topView]; + [self.view addSubview:self.topView]; [self.view addSubview:self.contentView]; [self.contentView addSubview:self.effectView]; - [self.contentView addSubview:self.stackView]; - [self.stackView addArrangedSubview:self.graffitiView]; + [self.contentView addSubview:self.stackView]; + [self.stackView addArrangedSubview:self.graffitiView]; [self.stackView addArrangedSubview:self.headTypeView]; - [self.stackView addArrangedSubview:self.userView]; - [self.stackView addArrangedSubview:self.giftInfoView]; - [self.stackView addArrangedSubview:self.giftBarView]; - [self.stackView addArrangedSubview:self.bottomView]; + [self.stackView addArrangedSubview:self.userView]; + [self.stackView addArrangedSubview:self.giftInfoView]; + [self.stackView addArrangedSubview:self.giftBarView]; + [self.stackView addArrangedSubview:self.bottomView]; } - (void)initSubViewConstraints { - [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.top.mas_equalTo(self.view); - make.bottom.mas_equalTo(self.contentView.mas_top);; - }]; - - [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.stackView.mas_top); - make.left.right.bottom.mas_equalTo(self.view); - }]; - + [self.topView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.mas_equalTo(self.view); + make.bottom.mas_equalTo(self.contentView.mas_top);; + }]; + + [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.stackView.mas_top); + make.left.right.bottom.mas_equalTo(self.view); + }]; + [self.effectView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.contentView); }]; - [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.bottom.mas_equalTo(self.contentView); - }]; - - [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(kSafeAreaBottomHeight); - }]; + [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.mas_equalTo(self.contentView); + }]; + + [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(kSafeAreaBottomHeight); + }]; } - (void)initHttpRequest { - [self.presenter getUserInfo:[AccountInfoStorage instance].getUid]; - [self.presenter getUserWallInfo]; - [self.presenter getNormalGiftList:self.roomUid]; - [self.presenter getPackGiftList]; - [self.presenter luckyGiftBroadcastRecord]; - [self.presenter getTwelveStarLastRankFirst:self.roomUid]; + [self.presenter getUserInfo:[AccountInfoStorage instance].getUid]; + [self.presenter getUserWallInfo]; + [self.presenter getNormalGiftList:self.roomUid]; + [self.presenter getPackGiftList]; + [self.presenter luckyGiftBroadcastRecord]; + [self.presenter getTwelveStarLastRankFirst:self.roomUid]; [self.presenter getGiftPrivilegeCardWithRoomUid:self.roomUid uid:[AccountInfoStorage instance].getUid]; } #pragma mark - Send Custom Message - (void)sendGraffitiGiftMessage { - if (self.segmentType == GiftSegmentType_Graffiti && self.graffitiPoint.count > 0) { - AttachmentModel * attachment = [[AttachmentModel alloc] init]; - attachment.first = CustomMessageType_Graffiti_Gift; - attachment.second = Custom_Message_Sub_Graffiti_Gift; - NSMutableDictionary * dic = [NSMutableDictionary dictionary]; - [dic setValue:@(self.giftInfoView.lastSelectGift.giftId) forKey:@"giftId"]; - [dic setValue:self.graffitiPoint forKey:@"drawFixedArray"]; - attachment.data = dic; - [self sendCustomMessage:attachment]; - } + if (self.segmentType == GiftSegmentType_Graffiti && self.graffitiPoint.count > 0) { + AttachmentModel * attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_Graffiti_Gift; + attachment.second = Custom_Message_Sub_Graffiti_Gift; + NSMutableDictionary * dic = [NSMutableDictionary dictionary]; + [dic setValue:@(self.giftInfoView.lastSelectGift.giftId) forKey:@"giftId"]; + [dic setValue:self.graffitiPoint forKey:@"drawFixedArray"]; + attachment.data = dic; + [self sendCustomMessage:attachment]; + } } - (void)sendCustomMessage:(GiftReceiveInfoModel *)receiveModel oringinDic:(NSDictionary *)originDic { - NSDictionary * dict = originDic; - if (receiveModel.roomSendGiftType == RoomSendGiftType_AllMic) { // 全麦 - NSMutableDictionary *data = [NSMutableDictionary dictionary]; - [data addEntriesFromDictionary:dict]; - if (receiveModel.gift.giftType == GiftType_Lucky) { // 如果是福袋 需要分开发送消息 - NSArray *luckyBagGifts = (NSArray *)[data objectForKey:@"luckyBagGifts"]; - if (luckyBagGifts.count >0) { - for (int i = 0; i < luckyBagGifts.count; i++) { - NSMutableDictionary * data1 = [NSMutableDictionary dictionary]; - [data1 addEntriesFromDictionary:dict]; - AttachmentModel * attachment = [[AttachmentModel alloc] init]; - attachment.first = CustomMessageType_AllMicroSend; - attachment.second = Custom_Message_Sub_AllMicroLuckySend; - NSDictionary * obj = [luckyBagGifts safeObjectAtIndex1:i]; - [data1 setObject:i == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"]; - [data1 setObject:obj forKey:@"luckyGiftList"]; - [data1 setObject:receiveModel.gift.giftName forKey:@"giftName"]; - [data1 setObject:[obj valueForKeyPath:@"user.uid"] forKey:@"targetUid"]; - [data1 setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; - if ([dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"]) { - [data1 setObject:[dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"] forKey:@"luckyGiftSvgaUrl"]; - } - [data1 removeObjectForKey:@"luckyBagGifts"]; - [data1 removeObjectForKey:@"targetUsers"]; - [data1 removeObjectForKey:@"gift"]; - attachment.data = data1; - [self sendCustomMessage:attachment]; - } - } - }else { // 全麦赠送普通礼物 包含背包礼物 - AttachmentModel * attachment = [[AttachmentModel alloc] init]; - attachment.first = CustomMessageType_AllMicroSend; - attachment.second = Custom_Message_Sub_AllMicroSend; - [data setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; - attachment.data = data; - [self sendCustomMessage:attachment]; - } - } else if (receiveModel.roomSendGiftType == RoomSendGiftType_MutableOnMic) { // 多人非全麦 - NSMutableDictionary *data = [NSMutableDictionary dictionary]; - [data addEntriesFromDictionary:dict]; - if (receiveModel.gift.giftType == GiftType_Lucky) { // 多人非全麦 福袋礼物 - NSArray *luckyBagGifts = (NSArray *)[data objectForKey:@"luckyBagGifts"]; - if (luckyBagGifts.count >0) { - // 产品想一个消息 多次发送 只能遍历插入消息体 - [luckyBagGifts enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - NSMutableDictionary * data1 = [NSMutableDictionary dictionary]; - [data1 addEntriesFromDictionary:dict]; - AttachmentModel * attachment = [[AttachmentModel alloc] init]; - attachment.first = CustomMessageType_AllMicroSend; - attachment.second = Custom_Message_Sub_AllBatchMicroLuckySend; - [data1 setObject:idx == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"]; - [data1 setObject:obj forKey:@"luckyGiftList"]; - [data1 setObject:receiveModel.gift.giftName forKey:@"giftName"]; - [data1 setObject:[obj valueForKeyPath:@"user.uid"] forKey:@"targetUid"]; - [data1 setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; - if ([dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"]) { - [data1 setObject:[dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"] forKey:@"luckyGiftSvgaUrl"]; - } - [data1 removeObjectForKey:@"luckyBagGifts"]; - [data1 removeObjectForKey:@"targetUsers"]; - attachment.data = data1; - [self sendCustomMessage:attachment]; - }]; - } - }else { // 多人非全麦 普通礼物 - AttachmentModel *attachment = [[AttachmentModel alloc] init]; - attachment.first = CustomMessageType_AllMicroSend; - attachment.second = Custom_Message_Sub_AllBatchSend; - attachment.data = data; - [self sendCustomMessage:attachment]; - } - } else if (receiveModel.roomSendGiftType == RoomSendGiftType_ToOne) { // 单人 - NSMutableDictionary *data = [NSMutableDictionary dictionary]; - [data addEntriesFromDictionary:dict]; - if (receiveModel.gift.giftType == GiftType_Lucky) { // 一对一 福袋礼物 - NSArray *luckyBagGifts = (NSArray *)[data objectForKey:@"luckyBagGifts"]; - [luckyBagGifts enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - NSMutableDictionary * data1 = [NSMutableDictionary dictionary]; - [data1 addEntriesFromDictionary:dict]; - AttachmentModel * attachment = [[AttachmentModel alloc] init]; - attachment.first = CustomMessageType_Gift; - attachment.second = Custom_Message_Sub_Gift_LuckySend; - [data1 setObject:idx == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"]; - [data1 setObject:obj forKey:@"luckyGiftList"]; - [data1 setObject:receiveModel.gift.giftName forKey:@"giftName"]; - [data1 setObject:[obj valueForKeyPath:@"user.uid"] forKey:@"targetUid"]; - [data1 setObject:[obj valueForKeyPath:@"user.nick"] forKey:@"targetNick"]; - [data1 setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; - if ([dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"]) { - [data1 setObject:[dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"] forKey:@"luckyGiftSvgaUrl"]; - } - [data1 removeObjectForKey:@"luckyBagGifts"]; - [data1 removeObjectForKey:@"targetUsers"]; - attachment.data = data1; - [self sendCustomMessage:attachment]; - }]; - }else { // 一对一 普通礼物 - AttachmentModel *attachment = [[AttachmentModel alloc] init]; - attachment.first = CustomMessageType_Gift; - attachment.second = Custom_Message_Sub_Gift_Send; - NSDictionary *targetUsers = ((NSArray *)[data objectForKey:@"targetUsers"]).firstObject; - [data setObject:[targetUsers valueForKeyPath:@"uid"] forKey:@"targetUid"]; - [data setObject:[targetUsers valueForKeyPath:@"nick"] forKey:@"targetNick"]; - [data setObject:[targetUsers valueForKeyPath:@"avatar"] forKey:@"targetAvatar"]; - attachment.data = data; - [self sendCustomMessage:attachment]; - } - } - + NSDictionary * dict = originDic; + if (receiveModel.roomSendGiftType == RoomSendGiftType_AllMic) { // 全麦 + NSMutableDictionary *data = [NSMutableDictionary dictionary]; + [data addEntriesFromDictionary:dict]; + if (receiveModel.gift.giftType == GiftType_Lucky) { // 如果是福袋 需要分开发送消息 + NSArray *luckyBagGifts = (NSArray *)[data objectForKey:@"luckyBagGifts"]; + if (luckyBagGifts.count >0) { + for (int i = 0; i < luckyBagGifts.count; i++) { + NSMutableDictionary * data1 = [NSMutableDictionary dictionary]; + [data1 addEntriesFromDictionary:dict]; + AttachmentModel * attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_AllMicroSend; + attachment.second = Custom_Message_Sub_AllMicroLuckySend; + NSDictionary * obj = [luckyBagGifts safeObjectAtIndex1:i]; + [data1 setObject:i == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"]; + [data1 setObject:obj forKey:@"luckyGiftList"]; + [data1 setObject:receiveModel.gift.giftName forKey:@"giftName"]; + [data1 setObject:[obj valueForKeyPath:@"user.uid"] forKey:@"targetUid"]; + [data1 setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; + + if ([dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"]) { + [data1 setObject:[dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"] forKey:@"luckyGiftSvgaUrl"]; + } + [data1 removeObjectForKey:@"luckyBagGifts"]; + [data1 removeObjectForKey:@"targetUsers"]; + [data1 removeObjectForKey:@"gift"]; + attachment.data = data1; + [self sendCustomMessage:attachment]; + } + } + }else { // 全麦赠送普通礼物 包含背包礼物 + AttachmentModel * attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_AllMicroSend; + attachment.second = Custom_Message_Sub_AllMicroSend; + [data setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; + attachment.data = data; + [self sendCustomMessage:attachment]; + } + } else if (receiveModel.roomSendGiftType == RoomSendGiftType_MutableOnMic) { // 多人非全麦 + NSMutableDictionary *data = [NSMutableDictionary dictionary]; + [data addEntriesFromDictionary:dict]; + if (receiveModel.gift.giftType == GiftType_Lucky) { // 多人非全麦 福袋礼物 + NSArray *luckyBagGifts = (NSArray *)[data objectForKey:@"luckyBagGifts"]; + if (luckyBagGifts.count >0) { + // 产品想一个消息 多次发送 只能遍历插入消息体 + [luckyBagGifts enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + NSMutableDictionary * data1 = [NSMutableDictionary dictionary]; + [data1 addEntriesFromDictionary:dict]; + AttachmentModel * attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_AllMicroSend; + attachment.second = Custom_Message_Sub_AllBatchMicroLuckySend; + [data1 setObject:idx == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"]; + [data1 setObject:obj forKey:@"luckyGiftList"]; + [data1 setObject:receiveModel.gift.giftName forKey:@"giftName"]; + [data1 setObject:[obj valueForKeyPath:@"user.uid"] forKey:@"targetUid"]; + [data1 setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; + if ([dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"]) { + [data1 setObject:[dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"] forKey:@"luckyGiftSvgaUrl"]; + } + [data1 removeObjectForKey:@"luckyBagGifts"]; + [data1 removeObjectForKey:@"targetUsers"]; + attachment.data = data1; + [self sendCustomMessage:attachment]; + }]; + } + }else { // 多人非全麦 普通礼物 + AttachmentModel *attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_AllMicroSend; + attachment.second = Custom_Message_Sub_AllBatchSend; + attachment.data = data; + [self sendCustomMessage:attachment]; + } + } else if (receiveModel.roomSendGiftType == RoomSendGiftType_ToOne) { // 单人 + NSMutableDictionary *data = [NSMutableDictionary dictionary]; + [data addEntriesFromDictionary:dict]; + if (receiveModel.gift.giftType == GiftType_Lucky) { // 一对一 福袋礼物 + NSArray *luckyBagGifts = (NSArray *)[data objectForKey:@"luckyBagGifts"]; + [luckyBagGifts enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + NSMutableDictionary * data1 = [NSMutableDictionary dictionary]; + [data1 addEntriesFromDictionary:dict]; + AttachmentModel * attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_Gift; + attachment.second = Custom_Message_Sub_Gift_LuckySend; + [data1 setObject:idx == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"]; + [data1 setObject:obj forKey:@"luckyGiftList"]; + [data1 setObject:receiveModel.gift.giftName forKey:@"giftName"]; + [data1 setObject:[obj valueForKeyPath:@"user.uid"] forKey:@"targetUid"]; + [data1 setObject:[obj valueForKeyPath:@"user.nick"] forKey:@"targetNick"]; + [data1 setObject:[dict valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; + if ([dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"]) { + [data1 setObject:[dict valueForKeyPath:@"gift.luckyGiftSvgaUrl"] forKey:@"luckyGiftSvgaUrl"]; + } + [data1 removeObjectForKey:@"luckyBagGifts"]; + [data1 removeObjectForKey:@"targetUsers"]; + attachment.data = data1; + [self sendCustomMessage:attachment]; + }]; + }else { // 一对一 普通礼物 + AttachmentModel *attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_Gift; + attachment.second = Custom_Message_Sub_Gift_Send; + NSDictionary *targetUsers = ((NSArray *)[data objectForKey:@"targetUsers"]).firstObject; + [data setObject:[targetUsers valueForKeyPath:@"uid"] forKey:@"targetUid"]; + [data setObject:[targetUsers valueForKeyPath:@"nick"] forKey:@"targetNick"]; + [data setObject:[targetUsers valueForKeyPath:@"avatar"] forKey:@"targetAvatar"]; + attachment.data = data; + [self sendCustomMessage:attachment]; + } + } + } - (void)sendCustomMessage:(AttachmentModel *)attachment { - - NSString *sessionID = self.usingplaceType == SendGiftType_User ? [NSString stringWithFormat:@"%ld", self.userArray.firstObject.uid] : [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].roomId]; - NIMMessage *message = [[NIMMessage alloc]init]; - NIMCustomObject *object = [[NIMCustomObject alloc] init]; - object.attachment = attachment; - message.messageObject = object; + + NSString *sessionID = self.usingplaceType == SendGiftType_User ? [NSString stringWithFormat:@"%ld", self.userArray.firstObject.uid] : [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].roomId]; + NIMMessage *message = [[NIMMessage alloc]init]; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachment; + message.messageObject = object; UserInfoModel *userInfo = [self.delegate getUserInfo]; XPMessageRemoteExtModel *extModel = [[XPMessageRemoteExtModel alloc] init]; extModel.androidBubbleUrl = userInfo.androidBubbleUrl; extModel.iosBubbleUrl = userInfo.iosBubbleUrl; - extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; NSMutableDictionary *remoteExt = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; message.remoteExt = remoteExt; - NIMSessionType sessionType = self.usingplaceType == SendGiftType_Room ? NIMSessionTypeChatroom : NIMSessionTypeP2P; - //构造会话 - NIMSession *session = [NIMSession session:sessionID type:sessionType]; - [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; + NIMSessionType sessionType = self.usingplaceType == SendGiftType_Room ? NIMSessionTypeChatroom : NIMSessionTypeP2P; + //构造会话 + NIMSession *session = [NIMSession session:sessionID type:sessionType]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; } #pragma mark - Deal Send Gift Data - (NSString *)dealSendGiftCount:(XPGiftCountModel *)model gift:(GiftInfoModel *)gift { - NSString * count = @"1"; - if (model.isTotal) { - count = [NSString stringWithFormat:@"%ld", gift.count]; - } else { - count = model.giftNumber; - } - - if (self.segmentType == GiftSegmentType_Graffiti) { - count = [NSString stringWithFormat:@"%ld", self.graffitiPoint.count]; - } - return count; + NSString * count = @"1"; + if (model.isTotal) { + count = [NSString stringWithFormat:@"%ld", gift.count]; + } else { + count = model.giftNumber; + } + + if (self.segmentType == GiftSegmentType_Graffiti) { + count = [NSString stringWithFormat:@"%ld", self.graffitiPoint.count]; + } + return count; } - (NSString *)dealSendGiftUids:(NSArray *)uids { - NSString *uidString = [[NSString alloc] init]; - for (NSString *item in uids) { - if (uidString.length > 0) { - uidString = [uidString stringByAppendingString:@","]; - } - uidString = [uidString stringByAppendingString:item]; - } - return uidString; + NSString *uidString = [[NSString alloc] init]; + for (NSString *item in uids) { + if (uidString.length > 0) { + uidString = [uidString stringByAppendingString:@","]; + } + uidString = [uidString stringByAppendingString:item]; + } + return uidString; } - (RoomSendGiftType)dealRoomSendGiftType:(GiftInfoModel *)giftInfo giftCount:(XPGiftCountModel *)giftCount { - NSArray * uids = self.userView.selectUserArray; - RoomSendGiftType roomSendGiftType; - if (self.userView.isSelectAll) { - if (giftInfo.sourceType == GiftSourceType_Pack && giftCount.isTotal && giftInfo && uids.count > 1) { - [self showErrorToast:@"只能全部赠送给一人"]; - return -1; - } - roomSendGiftType = RoomSendGiftType_AllMic; - } else if(self.userView.selectUserArray.count > 1) { - if (giftInfo.sourceType == GiftSourceType_Pack && giftCount.isTotal) { - [self showErrorToast:@"只能全部赠送给一人"]; - return -1; - } - roomSendGiftType = RoomSendGiftType_MutableOnMic; - } else if(self.userView.selectUserArray.count == 1) { - roomSendGiftType = RoomSendGiftType_ToOne; - } else { - roomSendGiftType = -1; - } - return roomSendGiftType; + NSArray * uids = self.userView.selectUserArray; + RoomSendGiftType roomSendGiftType; + if (self.userView.isSelectAll) { + if (giftInfo.sourceType == GiftSourceType_Pack && giftCount.isTotal && giftInfo && uids.count > 1) { + [self showErrorToast:@"只能全部赠送给一人"]; + return -1; + } + roomSendGiftType = RoomSendGiftType_AllMic; + } else if(self.userView.selectUserArray.count > 1) { + if (giftInfo.sourceType == GiftSourceType_Pack && giftCount.isTotal) { + [self showErrorToast:@"只能全部赠送给一人"]; + return -1; + } + roomSendGiftType = RoomSendGiftType_MutableOnMic; + } else if(self.userView.selectUserArray.count == 1) { + roomSendGiftType = RoomSendGiftType_ToOne; + } else { + roomSendGiftType = -1; + } + return roomSendGiftType; } #pragma mark - Public Method - (void)configGiftUsers:(NSArray *)users { - self.userArray = users; - [self.userView configGiftUsers:users]; - if (users.count <= 0 || self.usingplaceType == SendGiftType_User) { - self.userView.hidden = YES; - } else { - self.userView.hidden = NO; - } + self.userArray = users; + [self.userView configGiftUsers:users]; + if (users.count <= 0 || self.usingplaceType == SendGiftType_User) { + self.userView.hidden = YES; + } else { + self.userView.hidden = NO; + } } #pragma mark - XPGiftBarViewDelegate - (void)xPGiftBarView:(XPGiftBarView *)view didClickSendGift:(XPGiftCountModel *)giftCount { ///总礼物 三要素 送礼物的人 送的什么礼物 送多少个礼物 - NSArray * uids = self.userView.selectUserArray; + NSArray * uids = self.userView.selectUserArray; if(self.giftBarView.type == GiftSegmentType_Privilege){ XPPrivilegeCardItemModel *cardModel = self.giftInfoView.lastSelectPrivilege; if (self.usingplaceType == SendGiftType_Room) { @@ -377,79 +380,84 @@ [XCHUDTool showErrorWithMessage:@"今天该特权卡赠送次数已用完"]; return; } - self.giftBarView.sendPrivileButtonIsEnable = NO; - [self.presenter sendPrivilegeCardWithCardId:cardModel.ID roomUid:self.roomUid sendUid:[AccountInfoStorage instance].getUid cardUrl:cardModel.cardUrl]; + self.giftBarView.sendPrivileButtonIsEnable = NO; + [self.presenter sendPrivilegeCardWithCardId:cardModel.ID roomUid:self.roomUid sendUid:[AccountInfoStorage instance].getUid cardUrl:cardModel.cardUrl]; } return; } - GiftInfoModel * giftInfo = self.giftInfoView.lastSelectGift; - if (self.usingplaceType == SendGiftType_Room) { - if (uids.count > 0) { - ///送礼物的人 - NSString * uidString = [self dealSendGiftUids:uids]; - ///送礼物的个数 - NSString * giftNumber = [self dealSendGiftCount:giftCount gift:giftInfo]; - ///送的什么礼物 - NSString * giftId = [NSString stringWithFormat:@"%ld", giftInfo.giftId]; - ///给麦上的人送礼物 - GiftSendType sendType = GiftSendType_OnMic; - ///礼物来源 - GiftSourceType sourceType = giftInfo.sourceType; + GiftInfoModel * giftInfo = self.giftInfoView.lastSelectGift; + if (giftInfo.giftType == GiftType_Unlock && giftInfo.unlocked == NO){ + + [XCHUDTool showErrorWithMessage:@"暂未解锁该礼物,请留意上方的礼物解锁条件"]; + return; + } + if (self.usingplaceType == SendGiftType_Room) { + if (uids.count > 0) { + ///送礼物的人 + NSString * uidString = [self dealSendGiftUids:uids]; + ///送礼物的个数 + NSString * giftNumber = [self dealSendGiftCount:giftCount gift:giftInfo]; + ///送的什么礼物 + NSString * giftId = [NSString stringWithFormat:@"%ld", giftInfo.giftId]; + ///给麦上的人送礼物 + GiftSendType sendType = GiftSendType_OnMic; + ///礼物来源 + GiftSourceType sourceType = giftInfo.sourceType; if(sourceType != GiftSourceType_Normal && sourceType != GiftSourceType_Pack){ sourceType = _segmentType == GiftSegmentType_Pack ? GiftSourceType_Pack :GiftSourceType_Normal; } - ///送一个人 还是全麦 还是多人非全麦 - RoomSendGiftType roomSendType = [self dealRoomSendGiftType:giftInfo giftCount:giftCount]; - if (roomSendType == -1) { - return; - } - self.giftBarView.sendButtonIsEnable = NO; - ///发送消息 - [self.presenter sendGift:uidString giftNum:giftNumber sendType:sendType giftId:giftId giftSource:sourceType giftType:giftInfo.giftType roomSendType:roomSendType roomUid:self.roomUid msg:@""]; - } else { - [self showErrorToast:@"请选择至少一个人"]; - return; - } - } else if(self.usingplaceType == SendGiftType_User) { - ///送礼物的人 - NSString * uidString = [self dealSendGiftUids:uids]; - ///送礼物的个数 - NSString * giftNumber = [self dealSendGiftCount:giftCount gift:giftInfo]; - ///送的什么礼物 - NSString * giftId = [NSString stringWithFormat:@"%ld", giftInfo.giftId]; - ///给麦上的人送礼物 - GiftSendType sendType = GiftSendType_Chat; - ///礼物来源 - GiftSourceType sourceType = giftInfo.sourceType; + ///送一个人 还是全麦 还是多人非全麦 + RoomSendGiftType roomSendType = [self dealRoomSendGiftType:giftInfo giftCount:giftCount]; + if (roomSendType == -1) { + return; + } + self.giftBarView.sendButtonIsEnable = NO; + ///发送消息 + [self.presenter sendGift:uidString giftNum:giftNumber sendType:sendType giftId:giftId giftSource:sourceType giftType:giftInfo.giftType roomSendType:roomSendType roomUid:self.roomUid msg:@""]; + } else { + [self showErrorToast:@"请选择至少一个人"]; + return; + } + } else if(self.usingplaceType == SendGiftType_User) { + ///送礼物的人 + NSString * uidString = [self dealSendGiftUids:uids]; + ///送礼物的个数 + NSString * giftNumber = [self dealSendGiftCount:giftCount gift:giftInfo]; + ///送的什么礼物 + NSString * giftId = [NSString stringWithFormat:@"%ld", giftInfo.giftId]; + ///给麦上的人送礼物 + GiftSendType sendType = GiftSendType_Chat; + ///礼物来源 + GiftSourceType sourceType = giftInfo.sourceType; if(sourceType != GiftSourceType_Normal && sourceType != GiftSourceType_Pack){ sourceType = _segmentType == GiftSegmentType_Pack ? GiftSourceType_Pack :GiftSourceType_Normal; } - ///送一个人 还是全麦 还是多人非全麦 - RoomSendGiftType roomSendType = RoomSendGiftType_ToOne; - self.giftBarView.sendButtonIsEnable = NO; - [self.presenter sendGift:uidString giftNum:giftNumber sendType:sendType giftId:giftId giftSource:sourceType giftType:giftInfo.giftType roomSendType:roomSendType roomUid:self.roomUid msg:@""]; - } - + ///送一个人 还是全麦 还是多人非全麦 + RoomSendGiftType roomSendType = RoomSendGiftType_ToOne; + self.giftBarView.sendButtonIsEnable = NO; + [self.presenter sendGift:uidString giftNum:giftNumber sendType:sendType giftId:giftId giftSource:sourceType giftType:giftInfo.giftType roomSendType:roomSendType roomUid:self.roomUid msg:@""]; + } + } ///充值 - (void)xPGiftBarViewDidClickRecharge:(XPGiftBarView *)view { - [self dismissViewControllerAnimated:NO completion:^{ - XPMineHalfRechargeViewController * rechargeVC = [[XPMineHalfRechargeViewController alloc] init]; - rechargeVC.modalPresentationStyle = UIModalPresentationOverFullScreen; - if (self.delegate.getRoomInfo) { - rechargeVC.roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid]; - } - rechargeVC.currentNav = self.delegate.getCurrentNav ? self.delegate.getCurrentNav : [XCCurrentVCStackManager shareManager].getCurrentVC.navigationController; - [[XCCurrentVCStackManager shareManager].getCurrentVC presentViewController:rechargeVC animated:YES completion:nil]; - }]; + [self dismissViewControllerAnimated:NO completion:^{ + XPMineHalfRechargeViewController * rechargeVC = [[XPMineHalfRechargeViewController alloc] init]; + rechargeVC.modalPresentationStyle = UIModalPresentationOverFullScreen; + if (self.delegate.getRoomInfo) { + rechargeVC.roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid]; + } + rechargeVC.currentNav = self.delegate.getCurrentNav ? self.delegate.getCurrentNav : [XCCurrentVCStackManager shareManager].getCurrentVC.navigationController; + [[XCCurrentVCStackManager shareManager].getCurrentVC presentViewController:rechargeVC animated:YES completion:nil]; + }]; } - (void)xPGiftBarViewDidClickFirstRecharge:(XPGiftBarView *)view { - [self dismissViewControllerAnimated:NO completion:^{ - XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController]; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; - }]; + [self dismissViewControllerAnimated:NO completion:^{ + XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; + }]; } #pragma mark - XPGiftLuckyGiftBroadcastViewDelegate @@ -469,34 +477,35 @@ #pragma mark - XPGiftWeekStarBroadcastViewDelegate ///点击了周星榜入口 - (void)xPGiftWeekStarBroadcastViewWeekStarClick { - [self dismissViewControllerAnimated:NO completion:^{ - XPWebViewController * webVC = [[XPWebViewController alloc] init]; - webVC.roomUid = self.roomUid; - webVC.url = URLWithType(kNewWeekStarURL); - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; - }]; + [self dismissViewControllerAnimated:NO completion:^{ + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + webVC.roomUid = self.roomUid; + webVC.url = URLWithType(kNewWeekStarURL); + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; + }]; } #pragma mark - XPGiftHeadTypeViewDelegate ///点击了贵族 - (void)xPGiftHeadTypeViewDidClickNoble:(XPGiftHeadTypeView *)view { - [self dismissViewControllerAnimated:NO completion:^{ - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceGiftClick]; - XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid]; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:nobleVC animated:YES]; - }]; + [self dismissViewControllerAnimated:NO completion:^{ + [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceGiftClick]; + XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:nobleVC animated:YES]; + }]; } ///点击了首充 - (void)xPGiftHeadTypeViewDidClickFirstRecharge:(XPGiftHeadTypeView *)view { - [self dismissViewControllerAnimated:NO completion:^{ - XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController]; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; - }]; - + [self dismissViewControllerAnimated:NO completion:^{ + XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; + }]; + } ///点击了礼物 - (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view { [self.luckyBroadcastView removeFromSuperview]; + [self.unlockGiftView removeFromSuperview]; [self.giftInfoView giftHeadTypeHadChange:1]; if (!self.graffitiView.hidden) {//清空涂鸦礼物 [self.graffitiView clearData]; @@ -510,17 +519,45 @@ ///点击了互动 - (void)xPGiftHeadTypeViewDidClickInteraction:(XPGiftHeadTypeView *)view { [self.luckyBroadcastView removeFromSuperview]; + [self.unlockGiftView removeFromSuperview]; [self.giftInfoView giftHeadTypeHadChange:2]; } #pragma mark - XPGiftInfoViewDelegate - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickSegment:(GiftSegmentType)type { - self.segmentType = type; - self.giftBarView.type = type; - self.giftBarView.drawGiftCount = 0; - if (type == GiftSegmentType_Lucky) { + self.segmentType = type; + self.giftBarView.type = type; + self.giftBarView.drawGiftCount = 0; + if(type == GiftSegmentType_WeekStar) { + [self.luckyBroadcastView removeFromSuperview]; + [self.unlockGiftView removeFromSuperview]; + if ([ClientConfig shareConfig].configInfo.twelveStarSwitch) { + self.constellationBanner.hidden = NO; + if (!self.constellationBanner.superview) { + [self.view addSubview:self.constellationBanner]; + [self.constellationBanner mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.left.right.mas_equalTo(0); + make.height.mas_equalTo(75); + }]; + } + } else { + self.constellationBanner.hidden = YES; + } + } else { + [self.luckyBroadcastView removeFromSuperview]; + [self.unlockGiftView removeFromSuperview]; [self.constellationBanner removeFromSuperview]; - // self.presenter + } +} + +- (void)xPGiftInfoView:(XPGiftInfoView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type { + self.userView.hidden = self.userView.userArray.count == 0; + + + if (info.giftType == GiftType_Lucky) { + [self.constellationBanner removeFromSuperview]; + [self.unlockGiftView removeFromSuperview]; if (!self.luckyBroadcastView.superview) { [self.view addSubview:self.luckyBroadcastView]; [self.luckyBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -529,47 +566,71 @@ make.height.mas_equalTo(48); }]; } - } else if(type == GiftSegmentType_WeekStar) { - [self.luckyBroadcastView removeFromSuperview]; - if ([ClientConfig shareConfig].configInfo.twelveStarSwitch) { - self.constellationBanner.hidden = NO; - if (!self.constellationBanner.superview) { - [self.view addSubview:self.constellationBanner]; - [self.constellationBanner mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.contentView.mas_top); - make.left.right.mas_equalTo(0); - make.height.mas_equalTo(75); - }]; - } - } else { - self.constellationBanner.hidden = YES; - } - } else { + + + }else if(info.giftType == GiftType_Unlock){ [self.luckyBroadcastView removeFromSuperview]; [self.constellationBanner removeFromSuperview]; + CGFloat width = [UILabel getWidthWithText:@(info.baseGift.goldPrice).stringValue height:13 font:[UIFont systemFontOfSize:9 weight:UIFontWeightRegular]]; + info.baseGift.width = (width < 33 ? 33 : width) + 51; + if(info.giftId == info.baseGift.giftId){ + info.baseGift.isSelect = YES; + for (int i = 0; i < info.unlockGiftList.count; i++) { + MewUnlockGiftModel *obj = info.unlockGiftList[i]; + CGFloat unlockWidth = [UILabel getWidthWithText:[NSString stringWithFormat:@"送出 %d个 %@可解锁",obj.condition,info.baseGift.giftName] height:14 font:[UIFont systemFontOfSize:10 weight:UIFontWeightRegular]] + 43; + obj.width = unlockWidth; + obj.isSelect = NO; + } + }else{ + info.baseGift.isSelect = NO; + for (int i = 0; i < info.unlockGiftList.count; i++) { + MewUnlockGiftModel *obj = info.unlockGiftList[i]; + CGFloat unlockWidth = [UILabel getWidthWithText:[NSString stringWithFormat:@"送出 %d个 %@可解锁",obj.condition,info.baseGift.giftName] height:14 font:[UIFont systemFontOfSize:10 weight:UIFontWeightRegular]] + 43; + obj.width = unlockWidth; + obj.isSelect = obj.targetGift.giftId == info.giftId; + } + } + self.unlockGiftView.isDressUpGift = NO; + self.unlockGiftView.giftModel = info; + if (!self.unlockGiftView.superview) { + [self.view addSubview:self.unlockGiftView]; + [self.unlockGiftView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top).offset(-4); + make.left.right.equalTo(self.view).inset(6); + make.height.mas_equalTo(44); + }]; + } + }else if(info.giftType == GiftType_DressUp){ + self.unlockGiftView.isDressUpGift = YES; + [self.luckyBroadcastView removeFromSuperview]; + [self.constellationBanner removeFromSuperview]; + self.unlockGiftView.giftModel = info; + if (!self.unlockGiftView.superview) { + [self.view addSubview:self.unlockGiftView]; + [self.unlockGiftView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top).offset(-4); + make.left.right.equalTo(self.view).inset(6); + make.height.mas_equalTo(44); + }]; + } } -} - -- (void)xPGiftInfoView:(XPGiftInfoView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type { - self.userView.hidden = self.userView.userArray.count == 0; - - if (type == GiftSegmentType_Graffiti) { - self.giftInfoView.hidden = YES; - self.graffitiView.hidden = NO; - self.graffitiView.price = info.goldPrice; - self.giftBarView.drawGiftCount = 0; - self.graffitiView.selectUidNumber = self.userView.selectUserArray.count; - [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:info.giftUrl] options:SDWebImageProgressiveLoad progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { - if (error == nil && image) { - self.graffitiView.image = image; - } else { - self.giftInfoView.hidden = NO; - } - }]; - } else { - self.giftBarView.drawGiftCount = 10; - } + if (type == GiftSegmentType_Graffiti) { + self.giftInfoView.hidden = YES; + self.graffitiView.hidden = NO; + self.graffitiView.price = info.goldPrice; + self.giftBarView.drawGiftCount = 0; + self.graffitiView.selectUidNumber = self.userView.selectUserArray.count; + [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:info.giftUrl] options:SDWebImageProgressiveLoad progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) { + if (error == nil && image) { + self.graffitiView.image = image; + } else { + self.giftInfoView.hidden = NO; + } + }]; + } else { + self.giftBarView.drawGiftCount = 10; + } } - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickPrivilegeItem:(XPPrivilegeCardItemModel *)cardModel type:(GiftSegmentType)type{ if(cardModel == nil){ @@ -578,104 +639,124 @@ } self.giftBarView.privilegeCount = cardModel.dailyNum; self.giftBarView.privilegeArray = self.giftInfoView.privilegeArray; - - + + +} +#pragma mark - MewUnlockGiftBroadcastViewDelegate +- (void)mewUnlockGiftBroadcastViewDidChooseUnlockGift:(MewUnlockGiftModel *)giftModel{ + self.giftInfoView.unlockGiftModel = giftModel; +} +-(void)mewUnlockGiftBroadcastViewDidChooseDressUpGift:(GiftInfoModel *_Nullable)giftModel{ + if (giftModel.bannerSkipUrl.length == 0)return; + [self dismissViewControllerAnimated:NO completion:^{ + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + webVC.roomUid = self.roomUid; + webVC.url = giftModel.bannerSkipUrl; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; + }]; } #pragma mark - XPGiftUsersViewDelegate - (void)xPGiftUsersView:(XPGiftUsersView *)view didSelectUsers:(NSArray *)selectUids { - self.graffitiView.selectUidNumber = selectUids.count; + self.graffitiView.selectUidNumber = selectUids.count; } #pragma mark - XPGraffitiGiftViewDelegate - (void)xPGraffitiGiftView:(XPGraffitiGiftView *)view didClickClose:(UIButton *)sender { - [UIView animateWithDuration:0.2 animations:^{ - self.graffitiView.hidden = YES; - self.giftInfoView.hidden = NO; - }]; + [UIView animateWithDuration:0.2 animations:^{ + self.graffitiView.hidden = YES; + self.giftInfoView.hidden = NO; + }]; } - (void)xPGraffitiGiftView:(XPGraffitiGiftView *)view didClickChange:(UIButton *)sender { - [UIView animateWithDuration:0.2 animations:^{ - self.graffitiView.hidden = YES; - self.giftInfoView.hidden = NO; - }]; + [UIView animateWithDuration:0.2 animations:^{ + self.graffitiView.hidden = YES; + self.giftInfoView.hidden = NO; + }]; } - (void)xPGraffitiGiftView:(XPGraffitiGiftView *)view didDrawCompletion:(NSArray *)pointArray { - self.graffitiPoint = pointArray; - self.giftBarView.drawGiftCount = self.graffitiPoint.count; + self.graffitiPoint = pointArray; + self.giftBarView.drawGiftCount = self.graffitiPoint.count; } #pragma mark - XPGiftTwelveStarBroadcastViewDelegate - (void)xPGiftTwelveStarBroadcastView:(XPGiftTwelveStarBroadcastView *)view didClickDetail:(UIButton *)sender { - [self dismissViewControllerAnimated:NO completion:^{ - XPWebViewController * webVC = [[XPWebViewController alloc] init]; - webVC.url = URLWithType(kXinZuoStarURL); - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; - }]; + [self dismissViewControllerAnimated:NO completion:^{ + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + webVC.url = URLWithType(kXinZuoStarURL); + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; + }]; } #pragma mark - XPGiftProtocol - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo { self.headTypeView.isShowFirstRecharge = userInfo.isFirstCharge; - self.giftBarView.isShowFirstRecharge = userInfo.isFirstCharge; - self.giftInfoView.curUserNobleLevel = userInfo.userVipInfoVO.vipLevel; - + self.giftBarView.isShowFirstRecharge = userInfo.isFirstCharge; + self.giftInfoView.curUserNobleLevel = userInfo.userVipInfoVO.vipLevel; + } - (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo { - self.giftBarView.walletInfoModel = balanceInfo; + self.giftBarView.walletInfoModel = balanceInfo; } ///背包礼物 - (void)getPacketGiftListSuccess:(NSArray *)giftList { - self.giftInfoView.packOriginArray = giftList; + self.giftInfoView.packOriginArray = giftList; } - (void)getPacketGiftListFail:(NSString *)message { - self.packGiftRetryCount ++; - if (self.packGiftRetryCount <= 10) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self.presenter getPackGiftList]; - }); - } + self.packGiftRetryCount ++; + if (self.packGiftRetryCount <= 10) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.presenter getPackGiftList]; + }); + } } ///普通礼物 /幸运礼物 - (void)getNormalGiftListSuccess:(NSArray *)giftList { - self.giftInfoView.normalOriginArray = giftList; + self.giftInfoView.normalOriginArray = giftList; } - (void)getNormalGiftListFail:(NSString *)message { - self.normalGiftRetryCount ++; - if (self.normalGiftRetryCount <= 10) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self.presenter getNormalGiftList:self.roomUid]; - }); - } + self.normalGiftRetryCount ++; + if (self.normalGiftRetryCount <= 10) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.presenter getNormalGiftList:self.roomUid]; + }); + } } - (void)sendGiftSuccess:(GiftReceiveInfoModel *)receiveInfo originDic:(NSDictionary *)originDic uidCount:(NSInteger)uidCount{ - self.giftBarView.sendButtonIsEnable = YES; - if (receiveInfo.sourceType == GiftSourceType_Pack) { - ///更新个数 - [self.giftInfoView updatePackSource:receiveInfo numberUser:uidCount]; - } else { - [self.presenter getUserWallInfo]; - } - [self sendCustomMessage:receiveInfo oringinDic:originDic]; - ///发送涂鸦礼物消息 - [self sendGraffitiGiftMessage]; - if (self.segmentType == GiftSegmentType_Graffiti) { - NSString * title = [NSString stringWithFormat:@"发送涂鸦礼物:%@成功",self.giftInfoView.lastSelectGift.giftName]; - [self showSuccessToast:title]; - [self dismissViewControllerAnimated:YES completion:nil]; - } + + if (receiveInfo.gift.giftType == GiftType_Unlock){ + [self.giftInfoView updateGiftInfo:receiveInfo.gift count:(int)receiveInfo.giftNum]; + [self.unlockGiftView updateGiftInfo:receiveInfo.gift count:(int)receiveInfo.giftNum]; + + } + + self.giftBarView.sendButtonIsEnable = YES; + if (receiveInfo.sourceType == GiftSourceType_Pack) { + ///更新个数 + [self.giftInfoView updatePackSource:receiveInfo numberUser:uidCount]; + } else { + [self.presenter getUserWallInfo]; + } + [self sendCustomMessage:receiveInfo oringinDic:originDic]; + ///发送涂鸦礼物消息 + [self sendGraffitiGiftMessage]; + if (self.segmentType == GiftSegmentType_Graffiti) { + NSString * title = [NSString stringWithFormat:@"发送涂鸦礼物:%@成功",self.giftInfoView.lastSelectGift.giftName]; + [self showSuccessToast:title]; + [self dismissViewControllerAnimated:YES completion:nil]; + } } ///送礼物失败 - (void)sendGiftFailWithCode:(NSInteger)code msg:(NSString *)msg { - self.giftBarView.sendButtonIsEnable = YES; + self.giftBarView.sendButtonIsEnable = YES; if (code == 31005) {// 余额不足 [self showNotSufficientFundsWithToast:msg]; } else if (code == 8535) {//贵族等级未达到礼物等级 @@ -696,10 +777,10 @@ /// 余额不足,是否弹首充弹窗 - (void)showNotSufficientFundsWithToast:(NSString *)msg { if (self.delegate.getUserInfo.isFirstCharge) { - [self dismissViewControllerAnimated:NO completion:^{ - XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:XCCurrentVCStackManager.shareManager.getCurrentVC.navigationController]; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; - }]; + [self dismissViewControllerAnimated:NO completion:^{ + XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:XCCurrentVCStackManager.shareManager.getCurrentVC.navigationController]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; + }]; } else { [self showErrorToast:msg]; } @@ -707,12 +788,12 @@ - (void)luckyGiftBroadcastRecordSuccess:(NSArray *)records { - self.records = records; - self.luckyBroadcastView.records = records; + self.records = records; + self.luckyBroadcastView.records = records; } - (void)getTwelveStarLastRankFirstSuccess:(GiftTwelveStarFirstModel *)model { - self.constellationBanner.giftInfo = model; + self.constellationBanner.giftInfo = model; } -(void)getGiftPrivilegeCardSuccess:(NSArray *)list{ self.giftInfoView.privilegeArray = list; @@ -731,25 +812,25 @@ } #pragma mark - Event Response - (void)disMissViewRecognizer:(UITapGestureRecognizer *)tap { - [self dismissViewControllerAnimated:YES completion:nil]; + [self dismissViewControllerAnimated:YES completion:nil]; } #pragma mark - Getters And Setters #pragma mark - Getters And Setters - (void)setUsingplaceType:(SendGiftType)usingplaceType { - _usingplaceType = usingplaceType; - self.giftBarView.usingplaceType = usingplaceType; - self.giftInfoView.usingplaceType = _usingplaceType; - self.headTypeView.hidden = _usingplaceType == SendGiftType_User; - self.userView.hidden = _usingplaceType == SendGiftType_User; - self.effectView.hidden = _usingplaceType == SendGiftType_User; - if (_usingplaceType == SendGiftType_User) { - self.contentView.backgroundColor = [UIColor whiteColor]; - self.bottomView.backgroundColor = [UIColor whiteColor]; - } else { - self.contentView.backgroundColor = UIColor.clearColor; - self.bottomView.backgroundColor = [ThemeColor colorWithHexString:@"#161722"]; - } + _usingplaceType = usingplaceType; + self.giftBarView.usingplaceType = usingplaceType; + self.giftInfoView.usingplaceType = _usingplaceType; + self.headTypeView.hidden = _usingplaceType == SendGiftType_User; + self.userView.hidden = _usingplaceType == SendGiftType_User; + self.effectView.hidden = _usingplaceType == SendGiftType_User; + if (_usingplaceType == SendGiftType_User) { + self.contentView.backgroundColor = [UIColor whiteColor]; + self.bottomView.backgroundColor = [UIColor whiteColor]; + } else { + self.contentView.backgroundColor = UIColor.clearColor; + self.bottomView.backgroundColor = [ThemeColor colorWithHexString:@"#161722"]; + } } - (void)setSelectGiftId:(NSString *)selectGiftId { @@ -758,88 +839,88 @@ } - (void)setDelegate:(id)delegate { - _delegate = delegate; - if (_delegate) { + _delegate = delegate; + if (_delegate) { self.giftInfoView.roomInfo = [_delegate getRoomInfo]; - self.giftInfoView.roomType = _delegate.getRoomInfo.type; - - } + self.giftInfoView.roomType = _delegate.getRoomInfo.type; + + } } - (UIView *)topView { - if (!_topView) { - _topView = [[UIView alloc] init]; - _topView.backgroundColor = [UIColor clearColor]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissViewRecognizer:)]; - [_topView addGestureRecognizer:tap]; - } - return _topView; + if (!_topView) { + _topView = [[UIView alloc] init]; + _topView.backgroundColor = [UIColor clearColor]; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissViewRecognizer:)]; + [_topView addGestureRecognizer:tap]; + } + return _topView; } - (UIView *)contentView { - if (!_contentView) { - _contentView = [[UIView alloc] init]; + if (!_contentView) { + _contentView = [[UIView alloc] init]; UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth, KScreenHeight) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(8, 8)]; CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); maskLayer.path = maskPath.CGPath; _contentView.layer.mask = maskLayer; - } - return _contentView; + } + return _contentView; } - (XPGiftUsersView *)userView { - if (!_userView) { - _userView = [[XPGiftUsersView alloc] init]; - _userView.delegate = self; - } - return _userView; + if (!_userView) { + _userView = [[XPGiftUsersView alloc] init]; + _userView.delegate = self; + } + return _userView; } - (XPGiftInfoView *)giftInfoView { - if (!_giftInfoView) { - _giftInfoView = [[XPGiftInfoView alloc] init]; - _giftInfoView.delegate = self; - } - return _giftInfoView; + if (!_giftInfoView) { + _giftInfoView = [[XPGiftInfoView alloc] init]; + _giftInfoView.delegate = self; + } + return _giftInfoView; } - (XPGiftBarView *)giftBarView { - if (!_giftBarView) { - _giftBarView = [[XPGiftBarView alloc] init]; - _giftBarView.delegate = self; - } - return _giftBarView; + if (!_giftBarView) { + _giftBarView = [[XPGiftBarView alloc] init]; + _giftBarView.delegate = self; + } + 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; + if (!_stackView) { + _stackView = [[UIStackView alloc] init]; + _stackView.axis = UILayoutConstraintAxisVertical; + _stackView.distribution = UIStackViewDistributionFill; + _stackView.alignment = UIStackViewAlignmentFill; + _stackView.spacing = 0; + _stackView.backgroundColor = [UIColor clearColor]; + } + return _stackView; } - (UIView *)bottomView { - if (!_bottomView) { - _bottomView = [[UIView alloc] init]; - _bottomView.backgroundColor = [UIColor clearColor]; - } - return _bottomView; + if (!_bottomView) { + _bottomView = [[UIView alloc] init]; + _bottomView.backgroundColor = [UIColor clearColor]; + } + return _bottomView; } - (XPGraffitiGiftView *)graffitiView { - if (!_graffitiView) { - _graffitiView = [[XPGraffitiGiftView alloc] init]; - _graffitiView.hidden = YES; - _graffitiView.delegate = self; - } - return _graffitiView; + if (!_graffitiView) { + _graffitiView = [[XPGraffitiGiftView alloc] init]; + _graffitiView.hidden = YES; + _graffitiView.delegate = self; + } + return _graffitiView; } - (XPGiftHeadTypeView *)headTypeView { @@ -860,8 +941,8 @@ - (XPGiftTwelveStarBroadcastView *)constellationBanner { if (!_constellationBanner) { - _constellationBanner = [[XPGiftTwelveStarBroadcastView alloc] init]; - _constellationBanner.delegate = self; + _constellationBanner = [[XPGiftTwelveStarBroadcastView alloc] init]; + _constellationBanner.delegate = self; } return _constellationBanner; } @@ -874,5 +955,12 @@ } return _effectView; } +- (MewUnlockGiftBroadcastView *)unlockGiftView{ + if(!_unlockGiftView){ + _unlockGiftView = [[MewUnlockGiftBroadcastView alloc]initWithFrame:CGRectZero]; + _unlockGiftView.delegate = self; + } + return _unlockGiftView; +} @end diff --git a/xplan-ios/Main/Room/View/AcrossRoomPK/Model/AcrossRoomPKPanelModel.m b/xplan-ios/Main/Room/View/AcrossRoomPK/Model/AcrossRoomPKPanelModel.m index ec10e742..7042042e 100644 --- a/xplan-ios/Main/Room/View/AcrossRoomPK/Model/AcrossRoomPKPanelModel.m +++ b/xplan-ios/Main/Room/View/AcrossRoomPK/Model/AcrossRoomPKPanelModel.m @@ -19,6 +19,10 @@ }; } + + + + @end diff --git a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m index 14e4690d..0d4450cf 100644 --- a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -629,6 +629,8 @@ } if (roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode) { [Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + NSLog(@"%@",data.data); + NSLog(@"%@",data.data); if (code == 200) { AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data]; [self updateAnchorPkInfo:acrossPKPanelInfo]; diff --git a/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageFilter.m b/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageFilter.m index 5592adee..9fd10d98 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageFilter.m +++ b/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageFilter.m @@ -129,6 +129,11 @@ @(Custom_Message_Sub_Starred_Kitchen_Banner_Dynamic), @(Custom_Message_Sub_Starred_Kitchen_Banner_Static), nil], + @(CustomMessageType_UnlockGift_Update): + [NSSet setWithObjects: + @(Custom_Message_Sub_UnlockGift), + @(Custom_Message_Sub_DressUpGift), + nil], }; } @end diff --git a/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m b/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m index 71cfcef3..c2a40756 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/xplan-ios/Main/Room/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -54,6 +54,7 @@ #import "XPRoomPKResultView.h" #import "XPWebViewController.h" #import "XPPrivilegeCardItemModel.h" +#import "MewUnlockBaseGiftModel.h" @implementation XPRoomMessageParser - (XPMessageInfoModel*)parseMessageAttribute:(NIMMessage *)message { @@ -136,6 +137,11 @@ return [self createWelcomeAttribute:message messageInfo:messageInfo]; }else if(first == CustomMessageType_Privilege_Card){ return [self createPrivilegeCard:attachment messageInfo:messageInfo]; + }else if(first == CustomMessageType_UnlockGift_Update){ + if (attachment.second == Custom_Message_Sub_UnlockGift){ + return [self createUnlockGift:attachment messageInfo:messageInfo]; + } + return [self createDressUpGift:attachment messageInfo:messageInfo]; } return nil; } @@ -527,6 +533,44 @@ messageInfo.content = attribute; return messageInfo; } + +- (XPMessageInfoModel *)createDressUpGift:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{ + MewUnlockBaseGiftModel *unlockGift = [MewUnlockBaseGiftModel modelWithDictionary:attachment.data]; + NSMutableAttributedString * unlockGiftAtt = [[NSMutableAttributedString alloc] init]; + CGFloat fontSize = 12; + + NSString * nick = unlockGift.nick; + if (nick.length > 6) { + nick = [nick substringToIndex:6]; + } + [unlockGiftAtt appendAttributedString:[self createTextAttribute:nick color:[ThemeColor colorWithHexString:@"#FFD980"] font:fontSize]]; + [self attributeAddHihtLight:unlockGiftAtt uid:unlockGift.uid.integerValue]; + [unlockGiftAtt appendAttributedString:[self createTextAttribute:@" 获得 " color:[UIColor whiteColor] font:fontSize]]; + [unlockGiftAtt appendAttributedString:[self createTextAttribute:unlockGift.dressName color:[UIColor whiteColor] font:fontSize]]; + [unlockGiftAtt appendAttributedString:[self createUrlImageAttribute:unlockGift.dressUrl size:CGSizeMake(28, 28)]]; + + messageInfo.content = unlockGiftAtt; + return messageInfo; +} + +- (XPMessageInfoModel *)createUnlockGift:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{ + MewUnlockBaseGiftModel *unlockGift = [MewUnlockBaseGiftModel modelWithDictionary:attachment.data]; + NSMutableAttributedString * unlockGiftAtt = [[NSMutableAttributedString alloc] init]; + CGFloat fontSize = 12; + + NSString * nick = unlockGift.nick; + if (nick.length > 6) { + nick = [nick substringToIndex:6]; + } + [unlockGiftAtt appendAttributedString:[self createTextAttribute:nick color:[ThemeColor colorWithHexString:@"#FFD980"] font:fontSize]]; + [self attributeAddHihtLight:unlockGiftAtt uid:unlockGift.uid.integerValue]; + [unlockGiftAtt appendAttributedString:[self createTextAttribute:@" 已解锁礼物 " color:[UIColor whiteColor] font:fontSize]]; + [unlockGiftAtt appendAttributedString:[self createUrlImageAttribute:unlockGift.giftUrl size:CGSizeMake(28, 28)]]; + [unlockGiftAtt appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@ ",unlockGift.giftName] color:[ThemeColor colorWithHexString:@"#5CEFFF"] font:fontSize]]; + messageInfo.content = unlockGiftAtt; + return messageInfo; +} + - (XPMessageInfoModel *)createPrivilegeCard:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{ XPPrivilegeCardItemModel * giftInfo = [XPPrivilegeCardItemModel modelWithDictionary:attachment.data]; NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init]; @@ -1060,7 +1104,7 @@ if (attachment.second == Custom_Message_Sub_AllBatchSend || attachment.second == Custom_Message_Sub_AllMicroSend) {///普通礼物 if (attachment.second == Custom_Message_Sub_AllBatchSend) { //打赏 - [attribute appendAttributedString:[self createTextAttribute:@" 打赏 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; + [attribute appendAttributedString:[self createTextAttribute:@" 送出 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; for (int i = 0; i < info.targetUsers.count; i++) { GiftReceiveUserInfoModel *targetInfo = [info.targetUsers safeObjectAtIndex1:i]; @@ -1075,7 +1119,7 @@ } } else { //打赏 - [attribute appendAttributedString:[self createTextAttribute:@" 全麦打赏 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; + [attribute appendAttributedString:[self createTextAttribute:@" 全麦送出 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; } @@ -1184,7 +1228,7 @@ }]; } else { //打赏 - [attribute appendAttributedString:[self createTextAttribute:@" 打赏 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; + [attribute appendAttributedString:[self createTextAttribute:@" 送出 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; //target [attribute appendAttributedString: [self createNickAtrribute:info.targetNick uid:info.targetUid.integerValue]];