更新 Podfile 以注释掉不再使用的 ZLCollectionViewFlowLayout 依赖,同时新增勋章相关功能,包括勋章使用、广场、排行和管理列表的 API 方法,新增 MedalsModel、MedalsPresenter 和 MedalsViewController 相关文件,保持代码结构一致性。新增勋章相关的 UI 组件和本地化字符串支持。
2
Podfile
@@ -61,7 +61,7 @@ target 'YuMi' do
|
||||
|
||||
pod 'UMCommon'
|
||||
pod 'UMDevice'
|
||||
pod 'ZLCollectionViewFlowLayout'
|
||||
# pod 'ZLCollectionViewFlowLayout'
|
||||
pod 'TABAnimated'
|
||||
pod 'YuMi',:path=>'yum'
|
||||
pod 'QCloudCOSXML'
|
||||
|
@@ -485,6 +485,7 @@
|
||||
23FF42762AA6E1480055733C /* XPHomeRecommendOtherRoomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF42752AA6E1480055733C /* XPHomeRecommendOtherRoomView.m */; };
|
||||
23FF42792AA6E19C0055733C /* HomeMenuSourceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF42782AA6E19C0055733C /* HomeMenuSourceModel.m */; };
|
||||
23FF428E2AAB2D3A0055733C /* XPCandyTreeBuyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF428D2AAB2D3A0055733C /* XPCandyTreeBuyView.m */; };
|
||||
4C0A5B842E02675300955219 /* MedalsCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0A5B832E02675300955219 /* MedalsCollectionViewCell.m */; };
|
||||
4C1064882E0014CF007E1586 /* NSMutableArray+Safe.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1064872E0014CF007E1586 /* NSMutableArray+Safe.m */; };
|
||||
4C1119722DD7218300C18416 /* MyEventsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1119712DD7218300C18416 /* MyEventsViewController.m */; };
|
||||
4C1392932D6D963700A6DFB5 /* SubRechargersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1392922D6D963600A6DFB5 /* SubRechargersViewController.m */; };
|
||||
@@ -526,6 +527,10 @@
|
||||
4C85DB842DCDDD6800FD9839 /* CreateEventViewControllerV2.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C85DB832DCDDD6800FD9839 /* CreateEventViewControllerV2.m */; };
|
||||
4C864A022D55F4F600191AE0 /* LuckyPackagePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C864A012D55F4F600191AE0 /* LuckyPackagePresenter.m */; };
|
||||
4C864A052D561E1D00191AE0 /* LuckyPackageLogicManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C864A042D561E1D00191AE0 /* LuckyPackageLogicManager.m */; };
|
||||
4C886BE82E013C55006F0BA7 /* MedalsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C886BE72E013C55006F0BA7 /* MedalsViewController.m */; };
|
||||
4C886BEB2E014AE5006F0BA7 /* MedalsPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C886BEA2E014AE5006F0BA7 /* MedalsPresenter.m */; };
|
||||
4C886BEE2E014B6C006F0BA7 /* Api+Medals.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C886BED2E014B6C006F0BA7 /* Api+Medals.m */; };
|
||||
4C886BF22E015D61006F0BA7 /* MedalsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C886BF12E015D61006F0BA7 /* MedalsModel.m */; };
|
||||
4CA532B42D5AEE9400B8F59F /* Api+LuckyPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA532B32D5AEE9400B8F59F /* Api+LuckyPackage.m */; };
|
||||
4CA532B72D5B333200B8F59F /* RoomLuckyPackageInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA532B62D5B333200B8F59F /* RoomLuckyPackageInfoModel.m */; };
|
||||
4CA532BA2D5C8EBE00B8F59F /* LuckyPackageBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA532B92D5C8EBE00B8F59F /* LuckyPackageBannerView.m */; };
|
||||
@@ -2630,6 +2635,8 @@
|
||||
23FF42782AA6E19C0055733C /* HomeMenuSourceModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeMenuSourceModel.m; sourceTree = "<group>"; };
|
||||
23FF428C2AAB2D3A0055733C /* XPCandyTreeBuyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCandyTreeBuyView.h; sourceTree = "<group>"; };
|
||||
23FF428D2AAB2D3A0055733C /* XPCandyTreeBuyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCandyTreeBuyView.m; sourceTree = "<group>"; };
|
||||
4C0A5B822E02675300955219 /* MedalsCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MedalsCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
4C0A5B832E02675300955219 /* MedalsCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MedalsCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
4C1064862E0014CF007E1586 /* NSMutableArray+Safe.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+Safe.h"; sourceTree = "<group>"; };
|
||||
4C1064872E0014CF007E1586 /* NSMutableArray+Safe.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+Safe.m"; sourceTree = "<group>"; };
|
||||
4C1119702DD7218300C18416 /* MyEventsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyEventsViewController.h; sourceTree = "<group>"; };
|
||||
@@ -2708,6 +2715,14 @@
|
||||
4C864A012D55F4F600191AE0 /* LuckyPackagePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LuckyPackagePresenter.m; sourceTree = "<group>"; };
|
||||
4C864A032D561E1D00191AE0 /* LuckyPackageLogicManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LuckyPackageLogicManager.h; sourceTree = "<group>"; };
|
||||
4C864A042D561E1D00191AE0 /* LuckyPackageLogicManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LuckyPackageLogicManager.m; sourceTree = "<group>"; };
|
||||
4C886BE62E013C55006F0BA7 /* MedalsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MedalsViewController.h; sourceTree = "<group>"; };
|
||||
4C886BE72E013C55006F0BA7 /* MedalsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MedalsViewController.m; sourceTree = "<group>"; };
|
||||
4C886BE92E014AE5006F0BA7 /* MedalsPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MedalsPresenter.h; sourceTree = "<group>"; };
|
||||
4C886BEA2E014AE5006F0BA7 /* MedalsPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MedalsPresenter.m; sourceTree = "<group>"; };
|
||||
4C886BEC2E014B6C006F0BA7 /* Api+Medals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+Medals.h"; sourceTree = "<group>"; };
|
||||
4C886BED2E014B6C006F0BA7 /* Api+Medals.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+Medals.m"; sourceTree = "<group>"; };
|
||||
4C886BF02E015D61006F0BA7 /* MedalsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MedalsModel.h; sourceTree = "<group>"; };
|
||||
4C886BF12E015D61006F0BA7 /* MedalsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MedalsModel.m; sourceTree = "<group>"; };
|
||||
4CA532B22D5AEE9400B8F59F /* Api+LuckyPackage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+LuckyPackage.h"; sourceTree = "<group>"; };
|
||||
4CA532B32D5AEE9400B8F59F /* Api+LuckyPackage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+LuckyPackage.m"; sourceTree = "<group>"; };
|
||||
4CA532B52D5B333200B8F59F /* RoomLuckyPackageInfoModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomLuckyPackageInfoModel.h; sourceTree = "<group>"; };
|
||||
@@ -6826,6 +6841,26 @@
|
||||
path = RoomMode;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4C886BE42E013BF7006F0BA7 /* Medals */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4C886BE62E013C55006F0BA7 /* MedalsViewController.h */,
|
||||
4C886BE72E013C55006F0BA7 /* MedalsViewController.m */,
|
||||
4C0A5B822E02675300955219 /* MedalsCollectionViewCell.h */,
|
||||
4C0A5B832E02675300955219 /* MedalsCollectionViewCell.m */,
|
||||
);
|
||||
path = Medals;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4C886BEF2E015D48006F0BA7 /* Medals */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4C886BF02E015D61006F0BA7 /* MedalsModel.h */,
|
||||
4C886BF12E015D61006F0BA7 /* MedalsModel.m */,
|
||||
);
|
||||
path = Medals;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4CB753CE2D2FE80100B13DF5 /* RoomSideMenu */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -11350,6 +11385,8 @@
|
||||
E8E70D7D26F2F19D00F03460 /* Api+Mine.m */,
|
||||
54C9A11A2C3D9EDD00C6D970 /* Api+GameOrder.h */,
|
||||
54C9A11B2C3D9EDD00C6D970 /* Api+GameOrder.m */,
|
||||
4C886BEC2E014B6C006F0BA7 /* Api+Medals.h */,
|
||||
4C886BED2E014B6C006F0BA7 /* Api+Medals.m */,
|
||||
);
|
||||
path = Api;
|
||||
sourceTree = "<group>";
|
||||
@@ -11357,6 +11394,7 @@
|
||||
E8E70D7026F2EB3800F03460 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4C886BEF2E015D48006F0BA7 /* Medals */,
|
||||
E85E7B682A4EC39400B6D00A /* ExchangeAuthority */,
|
||||
E85E7B582A4EC35A00B6D00A /* RecordIncome */,
|
||||
9BD2ECCF288F832300F5CD9A /* FootPrint */,
|
||||
@@ -11394,6 +11432,7 @@
|
||||
E8E70D7126F2EB4900F03460 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4C886BE42E013BF7006F0BA7 /* Medals */,
|
||||
2331C12F2A5EB71000E1D940 /* Noble */,
|
||||
E84A2E7E2A527DF800D6AF8A /* IncomeRecord */,
|
||||
E85E7B732A4EC99200B6D00A /* GiveDiamond */,
|
||||
@@ -11497,6 +11536,8 @@
|
||||
9BD2ECD4288F838200F5CD9A /* XPMineFootPrintPresenter.m */,
|
||||
9BD8D4E428911F7700AE03FF /* XPMineCollectRoomListPresenter.h */,
|
||||
9BD8D4E528911F7700AE03FF /* XPMineCollectRoomListPresenter.m */,
|
||||
4C886BE92E014AE5006F0BA7 /* MedalsPresenter.h */,
|
||||
4C886BEA2E014AE5006F0BA7 /* MedalsPresenter.m */,
|
||||
);
|
||||
path = Presenter;
|
||||
sourceTree = "<group>";
|
||||
@@ -12097,6 +12138,7 @@
|
||||
E84BF7DA277C72AC00EF8877 /* XPRoomRoleTableViewCell.m in Sources */,
|
||||
E839532D276A030F00CF2F24 /* XPMineDressUpListViewController.m in Sources */,
|
||||
E821077B2987D4AB00DE7040 /* MessageFindNewGreetModel.m in Sources */,
|
||||
4C886BF22E015D61006F0BA7 /* MedalsModel.m in Sources */,
|
||||
E85E7BA32A4EC99300B6D00A /* XPMineGiveDiamondDetailsVC.m in Sources */,
|
||||
238A90072BA9729200828123 /* PIUniversalBannerView.m in Sources */,
|
||||
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */,
|
||||
@@ -12272,6 +12314,7 @@
|
||||
E85E7B042A4EB0D200B6D00A /* XPGuildIncomeDetailPresenter.m in Sources */,
|
||||
54B9C6F32C9D27F3003F1CC5 /* XPMineMultipleContentTableViewCell.m in Sources */,
|
||||
54F4693E2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m in Sources */,
|
||||
4C886BEB2E014AE5006F0BA7 /* MedalsPresenter.m in Sources */,
|
||||
9BD9A17C27A0EE24004186FE /* XPMineVisitorViewController.m in Sources */,
|
||||
2369F9912A89CE0E00563B48 /* PIUserSexView.m in Sources */,
|
||||
238B37D92AC55A2C00BFC9D5 /* XPTreasureFairyTrialsRecordView.m in Sources */,
|
||||
@@ -12798,6 +12841,7 @@
|
||||
9BA812DD28BF6A7300783EA7 /* XPRoomRedPacketPresenter.m in Sources */,
|
||||
E85E7B642A4EC35A00B6D00A /* XPIncomeRecordModel.m in Sources */,
|
||||
544879ED2CD22A6B00D58DC1 /* CustomRoomBGPresenter.m in Sources */,
|
||||
4C886BE82E013C55006F0BA7 /* MedalsViewController.m in Sources */,
|
||||
E85E7B082A4EB0D200B6D00A /* XPMineManagerSetPresenter.m in Sources */,
|
||||
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
|
||||
E81366F626F0C0DF0076364C /* LoginFullInfoPresenter.m in Sources */,
|
||||
@@ -13219,6 +13263,7 @@
|
||||
E85E7BA72A4EC99300B6D00A /* XPMineGiveDiamondPasswordView.m in Sources */,
|
||||
54283CEE2CE48B97009729B5 /* ShoppingMallDataPresent.m in Sources */,
|
||||
2331C1742A5EB71000E1D940 /* XPNobleCenterResidueView.m in Sources */,
|
||||
4C0A5B842E02675300955219 /* MedalsCollectionViewCell.m in Sources */,
|
||||
E80E2377299A47F60013FD40 /* AESUtils.m in Sources */,
|
||||
E81060E229876E9100B772F0 /* MessageImageModel.m in Sources */,
|
||||
E839533F276A0CDB00CF2F24 /* XPMineNameplateTableViewCell.m in Sources */,
|
||||
@@ -13439,6 +13484,7 @@
|
||||
E8788948273A55D000BF1D57 /* XPGiftBarView.m in Sources */,
|
||||
E89DCF5728FFF076001647EC /* XPWishGiftEmptyTableViewCell.m in Sources */,
|
||||
237700D32BC7CC7C00D661F1 /* NSObject+MJExtension.m in Sources */,
|
||||
4C886BEE2E014B6C006F0BA7 /* Api+Medals.m in Sources */,
|
||||
E8D4DE442940462C00EC788D /* XPGiftTwelveStarBroadcastView.m in Sources */,
|
||||
540EC1D02C89925F00F3BF0D /* GiftComboView.m in Sources */,
|
||||
E81060DF29876D3A00B772F0 /* MessageTimeModel.m in Sources */,
|
||||
|
6
YuMi/Assets.xcassets/20.20.61/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
21
YuMi/Assets.xcassets/20.20.61/medals_bottom_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "组 8485@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_bottom_bg.imageset/组 8485@3x.png
vendored
Normal file
After Width: | Height: | Size: 431 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_empty.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "空 3@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_empty.imageset/空 3@3x.png
vendored
Normal file
After Width: | Height: | Size: 32 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_lights.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "蒙版组 24@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_lights.imageset/蒙版组 24@3x.png
vendored
Normal file
After Width: | Height: | Size: 816 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_rank.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "排行@3x (1).png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_rank.imageset/排行@3x (1).png
vendored
Normal file
After Width: | Height: | Size: 1.1 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_square.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "排行@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_square.imageset/排行@3x.png
vendored
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
YuMi/Assets.xcassets/20.20.61/medals_tab_normal.imageset/5@3x.png
vendored
Normal file
After Width: | Height: | Size: 35 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_tab_normal.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "5@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_tab_selected.imageset/5@3x (1).png
vendored
Normal file
After Width: | Height: | Size: 38 KiB |
21
YuMi/Assets.xcassets/20.20.61/medals_tab_selected.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "5@3x (1).png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/20.20.61/medals_top_bg.imageset/2@3x.png
vendored
Normal file
After Width: | Height: | Size: 1.3 MiB |
21
YuMi/Assets.xcassets/20.20.61/medals_top_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "2@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
@@ -167,7 +167,14 @@
|
||||
return;
|
||||
}
|
||||
|
||||
self.shareInfo.shareType = item.type;
|
||||
// 添加类型安全检查,防止NSTaggedPointerString错误
|
||||
if ([self.shareInfo isKindOfClass:[XPShareInfoModel class]] && [item isKindOfClass:[XPShareItem class]]) {
|
||||
self.shareInfo.shareType = item.type;
|
||||
} else {
|
||||
NSLog(@"警告:self.shareInfo不是XPShareInfoModel类型,而是%@类型", NSStringFromClass([self.shareInfo class]));
|
||||
[TTPopup dismiss];
|
||||
return;
|
||||
}
|
||||
|
||||
SSDKPlatformType platformType = SSDKPlatformTypeCopy;
|
||||
|
||||
|
29
YuMi/Modules/YMMine/Api/Api+Medals.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Api+Medals.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/17.
|
||||
//
|
||||
|
||||
#import "Api.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface Api(Medals)
|
||||
/// 使用勋章,useStatus: 1-使用,0-取消使用
|
||||
+ (void)medalUseMedal:(HttpRequestHelperCompletion)completion id:(NSString *)id useStatus:(NSNumber *)useStatus;
|
||||
|
||||
/// 勋章广场,type: 勋章类型 1任务勋章 活动勋章,3荣耀勋章
|
||||
+ (void)medalSquare:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize type:(NSNumber *)type;
|
||||
|
||||
/// 勋章排行
|
||||
+ (void)medalRank:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize;
|
||||
|
||||
/// 勋章管理列表
|
||||
+ (void)medalMineAll:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize;
|
||||
|
||||
/// 指定用户的勋章, type: 勋章类型 1任务勋章 活动勋章,3荣耀勋章
|
||||
+ (void)medalMine:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize uid:(NSNumber *)uid type:(NSNumber *)type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
46
YuMi/Modules/YMMine/Api/Api+Medals.m
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// Api+Medals.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/17.
|
||||
//
|
||||
|
||||
#import "Api+Medals.h"
|
||||
|
||||
@implementation Api(Medals)
|
||||
|
||||
+ (void)medalUseMedal:(HttpRequestHelperCompletion)completion id:(NSString *)id useStatus:(NSNumber *)useStatus {
|
||||
[self makeRequest:@"medal/useMedal"
|
||||
method:HttpRequestHelperMethodPOST
|
||||
completion:completion,
|
||||
__FUNCTION__, id, useStatus, nil];
|
||||
}
|
||||
|
||||
+ (void)medalSquare:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize type:(NSNumber *)type {
|
||||
[self makeRequest:@"medal/useMedal"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__, pageNo, pageSize, type, nil];
|
||||
}
|
||||
|
||||
+ (void)medalRank:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize {
|
||||
[self makeRequest:@"medal/rank"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__, pageNo, pageSize, nil];
|
||||
}
|
||||
|
||||
+ (void)medalMineAll:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize {
|
||||
[self makeRequest:@"medal/mineAll"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__, pageNo, pageSize, nil];
|
||||
}
|
||||
|
||||
+ (void)medalMine:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize uid:(NSNumber *)uid type:(NSNumber *)type {
|
||||
[self makeRequest:@"medal/mine"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__, pageNo, pageSize, uid, type, nil];
|
||||
}
|
||||
@end
|
@@ -374,20 +374,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
+ (void)userCpNameTypeTopList:(HttpRequestHelperCompletion)completion uid:(NSInteger)uid;
|
||||
|
||||
/// 使用勋章,useStatus: 1-使用,0-取消使用
|
||||
+ (void)medalUseMedal:(HttpRequestHelperCompletion)completion id:(NSString *)id useStatus:(NSNumber *)useStatus;
|
||||
|
||||
/// 勋章广场,type: 勋章类型 1任务勋章 活动勋章,3荣耀勋章
|
||||
+ (void)medalSquare:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize type:(NSNumber *)type;
|
||||
|
||||
/// 勋章排行
|
||||
+ (void)medalRank:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize;
|
||||
|
||||
/// 勋章管理列表
|
||||
+ (void)medalMineAll:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize;
|
||||
|
||||
/// 指定用户的勋章, type: 勋章类型 1任务勋章 活动勋章,3荣耀勋章
|
||||
+ (void)medalMine:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize uid:(NSNumber *)uid type:(NSNumber *)type;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -498,39 +498,6 @@
|
||||
[self makeRequest:@"user/cp/nameTypeTopList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, @(uid), nil];
|
||||
}
|
||||
|
||||
+ (void)medalUseMedal:(HttpRequestHelperCompletion)completion id:(NSString *)id useStatus:(NSNumber *)useStatus {
|
||||
[self makeRequest:@"medal/useMedal"
|
||||
method:HttpRequestHelperMethodPOST
|
||||
completion:completion,
|
||||
__FUNCTION__, id, useStatus];
|
||||
}
|
||||
|
||||
+ (void)medalSquare:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize type:(NSNumber *)type {
|
||||
[self makeRequest:@"medal/useMedal"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__, pageNo, pageSize, type];
|
||||
}
|
||||
|
||||
+ (void)medalRank:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize {
|
||||
[self makeRequest:@"medal/rank"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__, pageNo, pageSize];
|
||||
}
|
||||
|
||||
+ (void)medalMineAll:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize {
|
||||
[self makeRequest:@"medal/mineAll"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__, pageNo, pageSize];
|
||||
}
|
||||
|
||||
+ (void)medalMine:(HttpRequestHelperCompletion)completion pageNo:(NSNumber *)pageNo pageSize:(NSNumber *)pageSize uid:(NSNumber *)uid type:(NSNumber *)type {
|
||||
[self makeRequest:@"medal/mine"
|
||||
method:HttpRequestHelperMethodGET
|
||||
completion:completion,
|
||||
__FUNCTION__, pageNo, pageSize, uid, type];
|
||||
}
|
||||
|
||||
@end
|
||||
|
56
YuMi/Modules/YMMine/Model/Medals/MedalsModel.h
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// MedalsModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/17.
|
||||
//
|
||||
|
||||
#import "PIBaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MedalVos : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) NSInteger expireSeconds;
|
||||
@property (nonatomic, assign) BOOL hasGain;
|
||||
@property (nonatomic, copy) NSString *id;
|
||||
@property (nonatomic, assign) NSInteger level;
|
||||
@property (nonatomic, copy) NSString *medalDesc;
|
||||
@property (nonatomic, copy) NSString *medalId;
|
||||
@property (nonatomic, copy) NSString *mp4Url;
|
||||
@property (nonatomic, copy) NSString *name;
|
||||
@property (nonatomic, copy) NSString *picUrl;
|
||||
@property (nonatomic, assign) BOOL useStatus;
|
||||
|
||||
@end
|
||||
|
||||
@interface MedalSeriesItemVo : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) NSInteger medalLevel;
|
||||
@property (nonatomic, copy) NSString *seriesName;
|
||||
@property (nonatomic, copy) NSArray <MedalVos *> *medalVos;
|
||||
|
||||
@end
|
||||
|
||||
@interface MedalSeriesVo : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) NSInteger type;
|
||||
@property (nonatomic, copy) NSArray <MedalSeriesItemVo *> *medalSeries;
|
||||
|
||||
@end
|
||||
|
||||
@interface UserMedalsModel : PIBaseModel
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
@property (nonatomic, assign) NSInteger erbanNo;
|
||||
@property (nonatomic, assign) NSInteger medalNum;
|
||||
@property (nonatomic, copy) NSString *nick;
|
||||
@property (nonatomic, assign) NSInteger uid;
|
||||
@property (nonatomic, copy) NSArray <MedalSeriesVo *> *medalSeries;
|
||||
@property (nonatomic, copy) NSArray *useMedals;
|
||||
@end
|
||||
|
||||
@interface MedalsModel : PIBaseModel
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
40
YuMi/Modules/YMMine/Model/Medals/MedalsModel.m
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// MedalsModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/17.
|
||||
//
|
||||
|
||||
#import "MedalsModel.h"
|
||||
|
||||
@implementation MedalVos
|
||||
|
||||
@end
|
||||
|
||||
@implementation MedalSeriesItemVo
|
||||
+ (NSDictionary *)mj_objectClassInArray {
|
||||
return @{
|
||||
@"medalVos" : [MedalVos class]
|
||||
};
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation MedalSeriesVo
|
||||
+ (NSDictionary *)mj_objectClassInArray {
|
||||
return @{
|
||||
@"medalSeries" : [MedalSeriesItemVo class]
|
||||
};
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation UserMedalsModel
|
||||
+ (NSDictionary *)mj_objectClassInArray {
|
||||
return @{
|
||||
@"medalSeries" : [MedalSeriesVo class]
|
||||
};
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation MedalsModel
|
||||
|
||||
@end
|
42
YuMi/Modules/YMMine/Presenter/MedalsPresenter.h
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// MedalsPresenter.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/17.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "MedalsModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol MedalsPresenterProtocol <NSObject>
|
||||
|
||||
- (void)userMedalsSuccess:(UserMedalsModel *)userMedalsModel;
|
||||
- (void)userMedalsFailure;
|
||||
|
||||
- (void)squareMedalsSuccess:(UserMedalsModel *)userMedalsModel;
|
||||
- (void)squareMedalsFailure;
|
||||
|
||||
@end
|
||||
|
||||
@interface MedalsPresenter : BaseMvpPresenter
|
||||
|
||||
/// 我的勋章页面(主/客态通用)
|
||||
/// - Parameters:
|
||||
/// - uid: 用户uid
|
||||
/// - page: 页码
|
||||
/// - type: 1任务勋章 活动勋章,3荣耀勋章
|
||||
- (void)userMedals:(NSInteger)uid
|
||||
page:(NSInteger)page
|
||||
type:(NSInteger)type;
|
||||
|
||||
/// 勋章廣場
|
||||
/// - Parameters:
|
||||
/// - page: 页码
|
||||
/// - type: 1任务勋章 活动勋章,3荣耀勋章
|
||||
- (void)squareMedals:(NSInteger)page
|
||||
type:(NSInteger)type;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
47
YuMi/Modules/YMMine/Presenter/MedalsPresenter.m
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// MedalsPresenter.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/17.
|
||||
//
|
||||
|
||||
#import "MedalsPresenter.h"
|
||||
#import "Api+Medals.h"
|
||||
|
||||
@implementation MedalsPresenter
|
||||
|
||||
- (void)userMedals:(NSInteger)uid page:(NSInteger)page type:(NSInteger)type {
|
||||
@kWeakify(self);
|
||||
[Api medalMine:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
if ([[self getView] respondsToSelector:@selector(userMedalsSuccess:)]) {
|
||||
UserMedalsModel *m = [UserMedalsModel modelWithJSON:data.data];
|
||||
[[self getView] userMedalsSuccess:m];
|
||||
}
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if ([[self getView] respondsToSelector:@selector(userMedalsFailure)]) {
|
||||
[[self getView] userMedalsFailure];
|
||||
}
|
||||
} showLoading:YES errorToast:YES]
|
||||
pageNo:@(page) pageSize:@(8) uid:@(uid) type:@(type)];
|
||||
}
|
||||
|
||||
- (void)squareMedals:(NSInteger)page type:(NSInteger)type {
|
||||
@kWeakify(self);
|
||||
[Api medalSquare:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
if ([[self getView] respondsToSelector:@selector(squareMedalsSuccess:)]) {
|
||||
UserMedalsModel *m = [UserMedalsModel modelWithJSON:data.data];
|
||||
[[self getView] squareMedalsSuccess:m];
|
||||
}
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if ([[self getView] respondsToSelector:@selector(squareMedalsFailure)]) {
|
||||
[[self getView] squareMedalsFailure];
|
||||
}
|
||||
} showLoading:YES errorToast:YES]
|
||||
pageNo:@(page) pageSize:@(8) type:@(type)];
|
||||
}
|
||||
|
||||
@end
|
@@ -84,6 +84,13 @@
|
||||
- (void)shareToUser:(NSString *)nick {
|
||||
NSString * title;
|
||||
AttachmentModel * attachment = [[AttachmentModel alloc] init];
|
||||
|
||||
// 添加类型安全检查
|
||||
if (![self.shareInfo isKindOfClass:[XPShareInfoModel class]]) {
|
||||
NSLog(@"警告:self.shareInfo不是XPShareInfoModel类型,而是%@类型", NSStringFromClass([self.shareInfo class]));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (self.shareType) {
|
||||
case MineShareType_Monents:
|
||||
{
|
||||
|
21
YuMi/Modules/YMMine/View/Medals/MedalsCollectionViewCell.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// MedalsCollectionViewCell.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
@class MedalSeriesVo;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MedalsCollectionViewCell : UICollectionViewCell
|
||||
|
||||
+ (void)registerTo:(UICollectionView *)collectionView;
|
||||
+ (instancetype)cellFor:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)index;
|
||||
|
||||
- (void)updateCell:(MedalSeriesVo *)model;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
150
YuMi/Modules/YMMine/View/Medals/MedalsCollectionViewCell.m
Normal file
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// MedalsCollectionViewCell.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/18.
|
||||
//
|
||||
|
||||
#import "MedalsCollectionViewCell.h"
|
||||
#import "MedalsModel.h"
|
||||
#import <QGVAPWrapView.h>
|
||||
#import "XPRoomGiftAnimationParser.h"
|
||||
|
||||
@interface MedalsCollectionViewCell ()
|
||||
|
||||
@property(nonatomic, copy) NSString *imagePath;
|
||||
@property(nonatomic, copy) NSString *mp4Path;
|
||||
|
||||
@property(nonatomic, strong) NetImageView *imageView;
|
||||
@property(nonatomic, strong) VAPView *mp4View;
|
||||
@property(nonatomic, strong) XPRoomGiftAnimationParser *mp4Parser;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UILabel *subLabel;
|
||||
|
||||
@property (nonatomic, strong) MedalVos *displayModel;
|
||||
@end
|
||||
|
||||
@implementation MedalsCollectionViewCell
|
||||
|
||||
+ (NSString *)cellID {
|
||||
return NSStringFromClass([MedalsCollectionViewCell class]);
|
||||
}
|
||||
|
||||
+ (void)registerTo:(UICollectionView *)collectionView {
|
||||
[collectionView registerClass:[self class] forCellWithReuseIdentifier:[self cellID]];
|
||||
}
|
||||
|
||||
+ (instancetype)cellFor:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)index {
|
||||
MedalsCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:[self cellID]
|
||||
forIndexPath:index];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self.contentView addGradientBackgroundWithColors:@[
|
||||
UIColorFromRGB(0x41007b),
|
||||
UIColorFromRGB(0x290858)
|
||||
] startPoint:CGPointMake(0.5, 0) endPoint:CGPointMake(0.5, 1) cornerRadius:8];
|
||||
|
||||
[self.contentView setAllCornerRadius:8
|
||||
borderWidth:1
|
||||
borderColor:UIColorFromRGB(0xa166bf)];
|
||||
|
||||
self.imageView = [[NetImageView alloc] init];
|
||||
self.imageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.contentView addSubview:self.imageView];
|
||||
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(13);
|
||||
make.leading.trailing.mas_equalTo(self.contentView).inset(13);
|
||||
make.height.mas_equalTo(self.imageView.mas_width);
|
||||
}];
|
||||
|
||||
[self addSubview:self.mp4View];
|
||||
[self.mp4View mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.imageView);
|
||||
}];
|
||||
|
||||
self.titleLabel = [UILabel labelInitWithText:@"" font:kFontMedium(14) textColor:[UIColor whiteColor]];
|
||||
self.subLabel = [UILabel labelInitWithText:@"" font:kFontRegular(11) textColor:[UIColor colorWithWhite:1 alpha:0.6]];
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.subLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.imageView.mas_bottom).offset(3);
|
||||
make.leading.trailing.mas_equalTo(self.contentView).inset(13);
|
||||
}];
|
||||
[self.contentView addSubview:self.subLabel];
|
||||
[self.subLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(7);
|
||||
make.leading.trailing.mas_equalTo(self.contentView).inset( 3);
|
||||
}];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)updateCell:(MedalSeriesVo *)model {
|
||||
MedalSeriesItemVo *itemVos = [model.medalSeries xpSafeObjectAtIndex:0];
|
||||
self.displayModel = [itemVos.medalVos xpSafeObjectAtIndex:0];
|
||||
if (self.displayModel) {
|
||||
if ([self.displayModel.picUrl hasSuffix:@"mp4"]) {
|
||||
[self setMp4Path:self.displayModel.picUrl];
|
||||
} else {
|
||||
[self setImagePath:self.displayModel.picUrl];
|
||||
}
|
||||
|
||||
self.titleLabel.text = self.displayModel.name;
|
||||
#if DEBUG
|
||||
self.displayModel.expireSeconds = 1750233926;
|
||||
#endif
|
||||
if (self.displayModel.expireSeconds == 0) {
|
||||
self.subLabel.text = YMLocalizedString(@"20.20.61_text_9");
|
||||
} else {
|
||||
self.subLabel.text = [NSString stringWithFormat:YMLocalizedString(@"20.20.61_text_8"),
|
||||
[NSDate timestampSwitchTime:self.displayModel.expireSeconds
|
||||
formatter:@"yyyy/mm/dd"]];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setImagePath:(NSString *)imagePath {
|
||||
_imagePath = imagePath;
|
||||
self.mp4View.hidden = YES;
|
||||
self.imageView.hidden = NO;
|
||||
self.imageView.imageUrl = imagePath;
|
||||
}
|
||||
|
||||
- (void)setMp4Path:(NSString *)mp4Path {
|
||||
_mp4Path = mp4Path;
|
||||
self.mp4View.hidden = NO;
|
||||
self.imageView.hidden = YES;
|
||||
if (!_mp4Parser) {
|
||||
self.mp4Parser = [[XPRoomGiftAnimationParser alloc] init];
|
||||
}
|
||||
@kWeakify(self);
|
||||
[self.mp4Parser parseWithURL:mp4Path
|
||||
completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
@kStrongify(self);
|
||||
if (![NSString isEmpty:videoUrl]) {
|
||||
[self.mp4View playHWDMP4:videoUrl repeatCount:-1 delegate:nil];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
- (VAPView *)mp4View {
|
||||
if (!_mp4View) {
|
||||
_mp4View = [[VAPView alloc] init];
|
||||
_mp4View.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _mp4View;
|
||||
}
|
||||
|
||||
@end
|
19
YuMi/Modules/YMMine/View/Medals/MedalsViewController.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// MedalsViewController.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/17.
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
@class UserInfoModel;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MedalsViewController : MvpViewController
|
||||
|
||||
- (instancetype)initForMyMedals:(UserInfoModel *)userInfo;
|
||||
- (instancetype)initForMedalsSquare;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
561
YuMi/Modules/YMMine/View/Medals/MedalsViewController.m
Normal file
@@ -0,0 +1,561 @@
|
||||
//
|
||||
// MedalsViewController.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/17.
|
||||
//
|
||||
|
||||
#import "MedalsViewController.h"
|
||||
#import "MedalsPresenter.h"
|
||||
#import "UserInfoModel.h"
|
||||
#import "TYCyclePagerView.h"
|
||||
#import "MedalsCollectionViewCell.h"
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
MedalsCenterTab_TaskMedals = 1,
|
||||
MedalsCenterTab_ActivityMedals = 2,
|
||||
MedalsCenterTab_GloryMedals = 3,
|
||||
} MedalsCenterTabType;
|
||||
|
||||
@interface MedalsViewController () <MedalsPresenterProtocol, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
|
||||
|
||||
@property (nonatomic, assign) BOOL isForMyMedals;
|
||||
@property (nonatomic, strong) UserInfoModel *userInfo;
|
||||
@property (nonatomic, copy) NSArray <UIButton *> *centerTabButtons;
|
||||
@property (nonatomic, strong) UILabel *medalDescLabel;
|
||||
@property (nonatomic, strong) UIButton *emptyUserMedalButton;
|
||||
@property (nonatomic, strong) UIView *emptyView;
|
||||
@property (nonatomic, copy) UICollectionView *medalsCollectionView;
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray <MedalSeriesVo *>*datasourceTaskMedals;
|
||||
@property (nonatomic, strong) NSMutableArray <MedalSeriesVo *>*datasourceActivityMedals;
|
||||
@property (nonatomic, strong) NSMutableArray <MedalSeriesVo *>*datasourceGloryMedals;
|
||||
|
||||
@property (nonatomic, assign) NSInteger currentPageTaskMedals;
|
||||
@property (nonatomic, assign) NSInteger currentPageActivityMedals;
|
||||
@property (nonatomic, assign) NSInteger currentPageGloryMedals;
|
||||
|
||||
@property (nonatomic, assign) MedalsCenterTabType currentTabType;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation MedalsViewController
|
||||
|
||||
- (instancetype)initForMyMedals:(UserInfoModel *)userInfo {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.isForMyMedals = YES;
|
||||
self.userInfo = userInfo;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initForMedalsSquare {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.isForMyMedals = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (MedalsPresenter *)createPresenter {
|
||||
return [[MedalsPresenter alloc] init];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[self setupUI];
|
||||
[self setupData];
|
||||
}
|
||||
|
||||
#pragma mark - UI
|
||||
- (void)setupUI {
|
||||
[self setupBackground];
|
||||
[self setupNavigationBar];
|
||||
[self setupCenterTabs];
|
||||
|
||||
if (self.userInfo.medals.medalCount == 0) {
|
||||
[self setupEmptyUserMedals];
|
||||
}
|
||||
|
||||
[self setupWearingButton];
|
||||
[self setupBottomMedalsList];
|
||||
[self setupEmptyView];
|
||||
}
|
||||
|
||||
- (void)setupNavigationBar {
|
||||
[self setupCustomNavigationBar:^{}
|
||||
title:YMLocalizedString(@"20.20.61_text_1")
|
||||
titleColor:[UIColor whiteColor]];
|
||||
[self setupCustonNavigationRightButtons:@[
|
||||
[self medalsRankButton],
|
||||
[self medalsSquareButton],
|
||||
] sizes:@[
|
||||
[NSValue valueWithCGSize:CGSizeMake(22, 22)],
|
||||
[NSValue valueWithCGSize:CGSizeMake(22, 22)]
|
||||
]];
|
||||
}
|
||||
|
||||
- (void)setupBackground {
|
||||
self.view.backgroundColor = UIColorFromRGB(0x1B0043);
|
||||
UIImageView *topBg = [self topBG];
|
||||
UIImageView *bottomBg = [self bottomBG];
|
||||
[self.view addSubview:topBg];
|
||||
[self.view addSubview:bottomBg];
|
||||
[topBg mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.trailing.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(kGetScaleWidth(314));
|
||||
}];
|
||||
[bottomBg mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.leading.trailing.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(kGetScaleWidth(445));
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupCenterTabs {
|
||||
UIStackView *centerTabsStackView = [self centerTabStack];
|
||||
[self.view addSubview:centerTabsStackView];
|
||||
[centerTabsStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(314));
|
||||
make.bottom.mas_equalTo(kGetScaleWidth(-445));
|
||||
make.leading.trailing.mas_equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupWearingButton {
|
||||
UIButton *wearingButton = [self wearingButton];
|
||||
[self.view addSubview:wearingButton];
|
||||
[wearingButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(90);
|
||||
make.trailing.mas_equalTo(-12);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupEmptyUserMedals {
|
||||
[self.view addSubview:self.emptyUserMedalButton];
|
||||
[self.emptyUserMedalButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(100);
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.size.mas_equalTo(CGSizeMake(184, 184));
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.medalDescLabel];
|
||||
self.medalDescLabel.text = YMLocalizedString(@"20.20.61_text_6");
|
||||
[self.medalDescLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(290));
|
||||
make.leading.trailing.mas_equalTo(self.view).inset(20);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupWearingUserMedals {
|
||||
[self.view addSubview:self.medalDescLabel];
|
||||
self.medalDescLabel.text = @"显示过期时间";//YMLocalizedString(@"20.20.61_text_6");
|
||||
[self.medalDescLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(kGetScaleWidth(290));
|
||||
make.leading.trailing.mas_equalTo(self.view).inset(20);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupScrollMedalsList {
|
||||
|
||||
}
|
||||
|
||||
- (void)setupBottomMedalsList {
|
||||
[self.view addSubview:self.medalsCollectionView];
|
||||
[self.medalsCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.view);
|
||||
make.trailing.leading.mas_equalTo(self.view).inset(26);
|
||||
make.height.mas_equalTo(kGetScaleWidth(380));
|
||||
}];
|
||||
|
||||
// 添加下拉刷新
|
||||
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
|
||||
header.lastUpdatedTimeLabel.hidden = YES;
|
||||
self.medalsCollectionView.mj_header = header;
|
||||
|
||||
// 添加上拉加载更多
|
||||
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
|
||||
self.medalsCollectionView.mj_footer = footer;
|
||||
}
|
||||
|
||||
- (void)setupEmptyView {
|
||||
self.emptyView.hidden = YES;
|
||||
[self.view insertSubview:self.emptyView
|
||||
belowSubview:self.medalsCollectionView];
|
||||
[self.emptyView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.trailing.mas_equalTo(self.medalsCollectionView);
|
||||
make.height.mas_equalTo(200);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Refresh Methods
|
||||
- (void)headerRefresh {
|
||||
NSInteger page = 1;
|
||||
switch (self.currentTabType) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
self.currentPageTaskMedals = 1;
|
||||
page = self.currentPageTaskMedals;
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
self.currentPageActivityMedals = 1;
|
||||
page = self.currentPageActivityMedals;
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
self.currentPageGloryMedals = 1;
|
||||
page = self.currentPageGloryMedals;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
[self loadMedalsList:self.currentTabType page:page];
|
||||
}
|
||||
|
||||
- (void)footerRefresh {
|
||||
NSInteger page = 1;
|
||||
switch (self.currentTabType) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
self.currentPageTaskMedals += 1;
|
||||
page = self.currentPageTaskMedals;
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
self.currentPageActivityMedals += 1;
|
||||
page = self.currentPageActivityMedals;
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
self.currentPageGloryMedals += 1;
|
||||
page = self.currentPageGloryMedals;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
[self loadMedalsList:self.currentTabType page:page];
|
||||
}
|
||||
|
||||
- (void)endReresh {
|
||||
[self.medalsCollectionView.mj_header endRefreshing];
|
||||
[self.medalsCollectionView.mj_footer endRefreshing];
|
||||
}
|
||||
|
||||
#pragma mark - Load datas
|
||||
- (void)setupData {
|
||||
self.datasourceTaskMedals = @[].mutableCopy;
|
||||
self.datasourceActivityMedals = @[].mutableCopy;
|
||||
self.datasourceGloryMedals = @[].mutableCopy;
|
||||
|
||||
self.currentPageTaskMedals = 1;
|
||||
self.currentPageActivityMedals = 1;
|
||||
self.currentPageGloryMedals = 1;
|
||||
|
||||
self.currentTabType = MedalsCenterTab_TaskMedals;
|
||||
|
||||
[self loadMedalsList:self.currentTabType page:1];
|
||||
}
|
||||
|
||||
- (void)loadMedalsList:(MedalsCenterTabType)tabType page:(NSInteger)tabPage {
|
||||
if (self.isForMyMedals) {
|
||||
[self.presenter userMedals:self.userInfo.uid
|
||||
page:tabPage
|
||||
type:tabPage];
|
||||
} else {
|
||||
[self.presenter squareMedals:tabPage
|
||||
type:tabType];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - MedalsPresenterProtocol
|
||||
- (void)userMedalsSuccess:(UserMedalsModel *)userMedalsModel {
|
||||
[self endReresh];
|
||||
[self _updateDataSource:userMedalsModel.medalSeries];
|
||||
}
|
||||
|
||||
- (void)userMedalsFailure {
|
||||
[self endReresh];
|
||||
[self _updateDataSource:@[]];
|
||||
}
|
||||
|
||||
- (void)squareMedalsSuccess:(UserMedalsModel *)userMedalsModel {
|
||||
[self endReresh];
|
||||
[self _updateDataSource:userMedalsModel.medalSeries];
|
||||
}
|
||||
|
||||
- (void)squareMedalsFailure {
|
||||
[self endReresh];
|
||||
}
|
||||
|
||||
- (void)_updateDataSource:(NSArray *)models {
|
||||
|
||||
if (models.count < 8) {
|
||||
[self.medalsCollectionView.mj_footer endRefreshingWithNoMoreData];
|
||||
}
|
||||
|
||||
switch (self.currentTabType) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
if (self.currentPageTaskMedals == 1) {
|
||||
self.emptyView.hidden = (models.count != 0);
|
||||
self.datasourceTaskMedals = models.mutableCopy;
|
||||
} else {
|
||||
[self.datasourceTaskMedals addObjectsFromArray:models];
|
||||
}
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
if (self.currentPageActivityMedals == 1) {
|
||||
self.emptyView.hidden = (models.count != 0);
|
||||
self.datasourceActivityMedals = models.mutableCopy;
|
||||
} else {
|
||||
[self.datasourceActivityMedals addObjectsFromArray:models];
|
||||
}
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
if (self.currentPageGloryMedals == 1) {
|
||||
self.emptyView.hidden = (models.count != 0);
|
||||
self.datasourceGloryMedals = models.mutableCopy;
|
||||
} else {
|
||||
[self.datasourceGloryMedals addObjectsFromArray:models];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
[self.medalsCollectionView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - Button actions
|
||||
- (void)didTapSquareButton:(UIButton *)sender {
|
||||
|
||||
}
|
||||
|
||||
- (void)didTapRankButton:(UIButton *)sender {
|
||||
|
||||
}
|
||||
|
||||
- (void)didTapWearingButton:(UIButton *)sender {
|
||||
|
||||
}
|
||||
|
||||
- (void)didTapEmptyMedalButton:(UIButton *)sender {
|
||||
|
||||
}
|
||||
|
||||
- (void)didTapCenterTab:(UIButton *)sender {
|
||||
if (sender.isSelected == YES) {
|
||||
return;
|
||||
}
|
||||
for (UIButton *b in self.centerTabButtons) {
|
||||
b.selected = NO;
|
||||
}
|
||||
sender.selected = YES;
|
||||
|
||||
switch (sender.tag) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
[self.presenter userMedals:self.userInfo.uid
|
||||
page:1
|
||||
type:1];
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
[self.presenter userMedals:self.userInfo.uid
|
||||
page:1
|
||||
type:2];
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
[self.presenter userMedals:self.userInfo.uid
|
||||
page:1
|
||||
type:3];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionView DataSource & Delegate
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
switch (self.currentTabType) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
return self.datasourceTaskMedals.count;
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
return self.datasourceActivityMedals.count;
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
return self.datasourceGloryMedals.count;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
MedalSeriesVo *model = nil;
|
||||
switch (self.currentTabType) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
model = [self.datasourceTaskMedals xpSafeObjectAtIndex:indexPath.item];
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
model = [self.datasourceActivityMedals xpSafeObjectAtIndex:indexPath.item];
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
model = [self.datasourceGloryMedals xpSafeObjectAtIndex:indexPath.item];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
MedalsCollectionViewCell *cell = [MedalsCollectionViewCell cellFor:collectionView atIndexPath:indexPath];
|
||||
[cell updateCell:model];
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - Lazy load
|
||||
- (UIButton *)medalsSquareButton {
|
||||
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[button addTarget:self action:@selector(didTapSquareButton:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[button setBackgroundImage:kImage(@"medals_square") forState:UIControlStateNormal];
|
||||
return button;
|
||||
}
|
||||
|
||||
- (UIButton *)medalsRankButton {
|
||||
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[button addTarget:self action:@selector(didTapRankButton:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[button setBackgroundImage:kImage(@"medals_rank") forState:UIControlStateNormal];
|
||||
return button;
|
||||
}
|
||||
|
||||
- (UIButton *)wearingButton {
|
||||
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[button addTarget:self action:@selector(didTapWearingButton:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[button setTitle:YMLocalizedString(@"20.20.61_text_2") forState:UIControlStateNormal];
|
||||
return button;
|
||||
}
|
||||
|
||||
- (UIImageView *)topBG {
|
||||
UIImageView *iv = [[UIImageView alloc] initWithImage:kImage(@"medals_top_bg")];
|
||||
iv.contentMode = UIViewContentModeScaleAspectFit;
|
||||
return iv;
|
||||
}
|
||||
|
||||
- (UIImageView *)bottomBG {
|
||||
UIImageView *iv = [[UIImageView alloc] initWithImage:kImage(@"medals_bottom_bg")];
|
||||
iv.contentMode = UIViewContentModeScaleAspectFit;
|
||||
return iv;
|
||||
}
|
||||
|
||||
- (UIButton *)taskMedalsButton:(MedalsCenterTabType)tabType {
|
||||
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
button.tag = tabType;
|
||||
switch (tabType) {
|
||||
case MedalsCenterTab_TaskMedals:
|
||||
[button setTitle:YMLocalizedString(@"20.20.61_text_3") forState:UIControlStateNormal];
|
||||
break;
|
||||
case MedalsCenterTab_ActivityMedals:
|
||||
[button setTitle:YMLocalizedString(@"20.20.61_text_4") forState:UIControlStateNormal];
|
||||
break;
|
||||
case MedalsCenterTab_GloryMedals:
|
||||
[button setTitle:YMLocalizedString(@"20.20.61_text_5") forState:UIControlStateNormal];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
[button addTarget:self action:@selector(didTapCenterTab:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[button setBackgroundImage:kImage(@"medals_tab_normal") forState:UIControlStateNormal];
|
||||
[button setBackgroundImage:kImage(@"medals_tab_selected") forState:UIControlStateSelected];
|
||||
[button setTitleColor:UIColorFromRGB(0xd8a2ff) forState:UIControlStateNormal];
|
||||
[button setTitleColor:UIColorFromRGB(0xFFFFFF) forState:UIControlStateSelected];
|
||||
[button.titleLabel setFont:kFontMedium(13)];
|
||||
[button setAdjustsImageWhenDisabled:NO];
|
||||
return button;
|
||||
}
|
||||
|
||||
- (UIStackView *)centerTabStack {
|
||||
UIButton *taskMedalsButton = [self taskMedalsButton:MedalsCenterTab_TaskMedals];
|
||||
taskMedalsButton.selected = YES;
|
||||
UIButton *activityMedalsButton = [self taskMedalsButton:MedalsCenterTab_ActivityMedals];
|
||||
UIButton *gloryMedalsButton = [self taskMedalsButton:MedalsCenterTab_GloryMedals];
|
||||
self.centerTabButtons = @[
|
||||
taskMedalsButton,
|
||||
activityMedalsButton,
|
||||
gloryMedalsButton
|
||||
];
|
||||
|
||||
UIStackView *stack = [[UIStackView alloc] initWithArrangedSubviews:self.centerTabButtons];
|
||||
stack.distribution = UIStackViewDistributionFillEqually;
|
||||
return stack;
|
||||
}
|
||||
|
||||
- (UILabel *)medalDescLabel {
|
||||
if (!_medalDescLabel) {
|
||||
_medalDescLabel = [UILabel labelInitWithText:@""
|
||||
font:kFontRegular(12)
|
||||
textColor:[UIColor whiteColor]];
|
||||
_medalDescLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _medalDescLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)emptyUserMedalButton {
|
||||
if (!_emptyUserMedalButton) {
|
||||
_emptyUserMedalButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_emptyUserMedalButton setImage:kImage(@"medals_empty")
|
||||
forState:UIControlStateNormal];
|
||||
[_emptyUserMedalButton addTarget:self
|
||||
action:@selector(didTapEmptyMedalButton:)
|
||||
forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _emptyUserMedalButton;
|
||||
}
|
||||
|
||||
- (UICollectionView *)medalsCollectionView {
|
||||
if (!_medalsCollectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.itemSize = CGSizeMake(kGetScaleWidth(156), kGetScaleWidth(218));
|
||||
layout.minimumInteritemSpacing = 6;
|
||||
layout.minimumLineSpacing = 6;
|
||||
_medalsCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_medalsCollectionView.backgroundColor = [UIColor clearColor];
|
||||
_medalsCollectionView.delegate = self;
|
||||
_medalsCollectionView.dataSource = self;
|
||||
[MedalsCollectionViewCell registerTo:_medalsCollectionView];
|
||||
}
|
||||
return _medalsCollectionView;
|
||||
}
|
||||
|
||||
- (UIView *)emptyView {
|
||||
if (!_emptyView) {
|
||||
_emptyView = [[UIView alloc] init];
|
||||
_emptyView.backgroundColor = [UIColor clearColor];
|
||||
|
||||
UILabel *titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"20.20.61_text_7")
|
||||
font:kFontRegular(14)
|
||||
textColor:UIColorFromRGB(0xafb1b3)];
|
||||
titleLabel.numberOfLines = 2;
|
||||
titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
UIImageView *ufoImageView = [[UIImageView alloc] initWithImage:kImage(@"common_empty_UFO")];
|
||||
|
||||
[_emptyView addSubview:ufoImageView];
|
||||
[_emptyView addSubview:titleLabel];
|
||||
|
||||
[ufoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(_emptyView);
|
||||
make.top.mas_equalTo(20);
|
||||
make.size.mas_equalTo(CGSizeMake(110, 110));
|
||||
}];
|
||||
|
||||
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(_emptyView);
|
||||
make.top.mas_equalTo(ufoImageView.mas_bottom).offset(10);
|
||||
make.leading.trailing.mas_equalTo(_emptyView).inset(20);
|
||||
}];
|
||||
}
|
||||
return _emptyView;
|
||||
}
|
||||
|
||||
@end
|
@@ -71,6 +71,7 @@
|
||||
|
||||
#import "XPSkillCardPlayerManager.h"
|
||||
#import "XPMineFriendViewController.h"
|
||||
#import "MedalsViewController.h"
|
||||
|
||||
|
||||
UIKIT_EXTERN NSString *kRequestTicket;
|
||||
@@ -228,6 +229,9 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case XPMineItemType_My_Medal:
|
||||
[self clickMedalsAction];
|
||||
break;
|
||||
case XPMineItemType_My_Agent:
|
||||
[self clickHallAction];
|
||||
break;
|
||||
@@ -470,6 +474,12 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
XPMineFunctionItemModel *item = self.functionArray[indexPath.row];
|
||||
[self pushViewControllerWithType:item.skipType functionItem:item];
|
||||
}
|
||||
|
||||
- (void)clickMedalsAction {
|
||||
MedalsViewController *vc = [[MedalsViewController alloc] initForMyMedals:self.userInfo];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
///跳转到公会
|
||||
-(void)clickHallAction{
|
||||
if(self.clanInfo == nil)return;
|
||||
|
@@ -199,6 +199,12 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
// 注册分享回调事件
|
||||
|
||||
[[SocialShareManager sharedManager] setHandleJumpToRoom:^(ShareItmeInfo * _Nonnull shareItem) {
|
||||
// 添加类型安全检查,防止NSTaggedPointerString错误
|
||||
if (![shareItem isKindOfClass:[ShareItmeInfo class]]) {
|
||||
NSLog(@"警告:shareItem不是ShareItmeInfo类型,而是%@类型", NSStringFromClass([shareItem class]));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (shareItem.shareType) {
|
||||
case 1: { // 跳转到房间
|
||||
NSString *roomID = shareItem.targetUid;
|
||||
@@ -946,7 +952,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
} else if ([dic[@"first"] intValue] == CustomMessageType_Task_Complete && [dic[@"second"] intValue] == Custom_Message_Sub_TaskComplete) {///任务完成提醒
|
||||
if ([dic isKindOfClass:[NSDictionary class]]) {
|
||||
NSDictionary *dict = dic[@"data"];
|
||||
[self handleActivityTaskTip:dict[@"taskCompleteMsg"] url:dic[@"taskUrl"]];
|
||||
[self handleActivityTaskTip:dict[@"taskCompleteMsg"] url:dict[@"taskUrl"]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -813,14 +813,25 @@ NSString * const kJSShowShareCallBack = @"showShareAction";
|
||||
NSString *uid = [AccountInfoStorage instance].getUid;
|
||||
NSString *ticket = [AccountInfoStorage instance].getTicket;
|
||||
[params setObject:uid forKey:@"uid"];
|
||||
[params setObject:@(shareInfo.shareType) forKey:@"shareType"];
|
||||
[params setObject:ticket forKey:@"ticket"];
|
||||
[params setObject:@(shareInfo.type) forKey:@"sharePageId"];
|
||||
if (shareInfo.shareUrl.length > 0) {
|
||||
[params setObject:shareInfo.shareUrl forKey:@"shareUrl"];
|
||||
|
||||
// 添加类型安全检查,防止NSTaggedPointerString错误
|
||||
if ([shareInfo isKindOfClass:[XPShareInfoModel class]]) {
|
||||
[params setObject:@(shareInfo.shareType) forKey:@"shareType"];
|
||||
} else {
|
||||
// 如果不是预期类型,提供默认值
|
||||
[params setObject:@(0) forKey:@"shareType"];
|
||||
NSLog(@"警告:shareInfo不是XPShareInfoModel类型,而是%@类型", NSStringFromClass([shareInfo class]));
|
||||
}
|
||||
if (shareInfo.roomUid > 0) {
|
||||
[params setObject:@(shareInfo.roomUid) forKey:@"targetUid"];
|
||||
|
||||
[params setObject:ticket forKey:@"ticket"];
|
||||
if ([shareInfo isKindOfClass:[XPShareInfoModel class]]) {
|
||||
[params setObject:@(shareInfo.type) forKey:@"sharePageId"];
|
||||
if (shareInfo.shareUrl.length > 0) {
|
||||
[params setObject:shareInfo.shareUrl forKey:@"shareUrl"];
|
||||
}
|
||||
if (shareInfo.roomUid > 0) {
|
||||
[params setObject:@(shareInfo.roomUid) forKey:@"targetUid"];
|
||||
}
|
||||
}
|
||||
|
||||
[HttpRequestHelper POST:@"usershare/save" params:params success:^(BaseModel * _Nonnull data) {
|
||||
|
@@ -8,7 +8,6 @@
|
||||
#import "Api.h"
|
||||
#import <Base64/MF_Base64Additions.h>
|
||||
@implementation Api
|
||||
|
||||
+ (void)makeRequest:(NSString *)route method:(HttpRequestHelperMethod)method completion:(HttpRequestHelperCompletion)completion, ... {
|
||||
va_list arg_lists;
|
||||
va_start(arg_lists, completion);
|
||||
|
@@ -23,6 +23,9 @@ typedef void(^HeaderRefreshComplete)(void);
|
||||
|
||||
- (void)setupTopTheme;
|
||||
|
||||
- (void)setupCustomNavigationBar:(void(^)(void))backAction title:(NSString *)title titleColor:(UIColor *)color;
|
||||
- (void)setupCustonNavigationRightButtons:(NSArray <UIButton *>*)array sizes:(NSArray <NSValue *> *)sizes;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -21,6 +21,10 @@
|
||||
|
||||
@interface MvpViewController ()
|
||||
|
||||
@property (nonatomic, copy) void(^backAction)(void);
|
||||
@property (nonatomic, strong) UILabel *mvpTitleLabel;
|
||||
@property (nonatomic, strong) UIButton *backButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MvpViewController
|
||||
@@ -53,6 +57,54 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setupCustomNavigationBar:(void(^)(void))backAction title:(NSString *)title titleColor:(UIColor *)color {
|
||||
UILabel *titleLabel = [self mvpTitleLabel];
|
||||
titleLabel.text = title;
|
||||
titleLabel.textColor = color;
|
||||
[self.view addSubview:titleLabel];
|
||||
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.view);
|
||||
make.top.mas_equalTo(self.view).offset(kStatusBarHeight);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
|
||||
UIButton *backButton = [self mvpBackButton];
|
||||
[self.view addSubview:backButton];
|
||||
[backButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(self.view).offset(16);
|
||||
make.centerY.mas_equalTo(titleLabel);
|
||||
make.size.mas_equalTo(CGSizeMake(22, 22));
|
||||
}];
|
||||
|
||||
self.backAction = backAction;
|
||||
}
|
||||
|
||||
- (void)setupCustonNavigationRightButtons:(NSArray <UIButton *>*)array
|
||||
sizes:(NSArray <NSValue *> *)sizes {
|
||||
if (array.count > 0 && self->_mvpTitleLabel) {
|
||||
CGFloat trailing = -16;
|
||||
for (UIButton *b in array) {
|
||||
NSInteger index = [array indexOfObject:b];
|
||||
NSValue *sizeValue = [sizes xpSafeObjectAtIndex:index];
|
||||
[self.view addSubview:b];
|
||||
[b mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(self.view).offset(trailing);
|
||||
make.centerY.mas_equalTo(self.mvpTitleLabel);
|
||||
make.size.mas_equalTo([sizeValue CGSizeValue]);
|
||||
}];
|
||||
|
||||
trailing -= 14 + [sizeValue CGSizeValue].width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didTapBack {
|
||||
if (self.backAction) {
|
||||
self.backAction();
|
||||
}
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
#ifdef DEBUG
|
||||
@@ -136,4 +188,28 @@
|
||||
// }];
|
||||
//}
|
||||
|
||||
- (UILabel *)mvpTitleLabel {
|
||||
if (!_mvpTitleLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.font = kFontMedium(17);
|
||||
label.textColor = UIColorFromRGB(0xD9E7F7);
|
||||
_mvpTitleLabel = label;
|
||||
}
|
||||
return _mvpTitleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)mvpBackButton {
|
||||
if (!_backButton) {
|
||||
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[b setImage:[kImage(@"common_nav_back_white") ms_SetImageForRTL]
|
||||
forState:UIControlStateNormal];
|
||||
[b addTarget:self
|
||||
action:@selector(didTapBack)
|
||||
forControlEvents:UIControlEventTouchUpInside];
|
||||
_backButton = b;
|
||||
}
|
||||
return _backButton;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -74,8 +74,14 @@
|
||||
|
||||
- (void)checkSocialShareItem {
|
||||
if (self.shareItem) {
|
||||
// 添加类型安全检查
|
||||
if (![self.shareItem isKindOfClass:[ShareItmeInfo class]]) {
|
||||
NSLog(@"警告:shareItem不是ShareItmeInfo类型,而是%@类型", NSStringFromClass([self.shareItem class]));
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.handleJumpToRoom) {
|
||||
self.handleJumpToRoom(self.shareItem.targetUid);
|
||||
self.handleJumpToRoom(self.shareItem);
|
||||
[self cleanCache];
|
||||
}
|
||||
}
|
||||
@@ -91,10 +97,23 @@
|
||||
[Api shareGetInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200) {
|
||||
self.shareItem = [ShareItmeInfo modelWithJSON:data.data];
|
||||
if (self.handleJumpToRoom) {
|
||||
self.handleJumpToRoom(self.shareItem);
|
||||
[self cleanCache];
|
||||
// 添加类型安全检查
|
||||
id jsonData = data.data;
|
||||
if ([jsonData isKindOfClass:[NSDictionary class]]) {
|
||||
self.shareItem = [ShareItmeInfo modelWithJSON:jsonData];
|
||||
|
||||
// 确保shareItem是正确的类型
|
||||
if (![self.shareItem isKindOfClass:[ShareItmeInfo class]]) {
|
||||
NSLog(@"警告:解析后的shareItem不是ShareItmeInfo类型,而是%@类型", NSStringFromClass([self.shareItem class]));
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.handleJumpToRoom) {
|
||||
self.handleJumpToRoom(self.shareItem);
|
||||
[self cleanCache];
|
||||
}
|
||||
} else {
|
||||
NSLog(@"警告:API返回的data.data不是字典类型,而是%@类型", NSStringFromClass([jsonData class]));
|
||||
}
|
||||
}
|
||||
} code:shareCode];
|
||||
|
@@ -3656,3 +3656,13 @@
|
||||
"20.20.59_text_34" = "提交成功";
|
||||
"20.20.59_text_35" = "訂閱成功";
|
||||
"20.20.59_text_36" = "取消成功";
|
||||
|
||||
"20.20.61_text_1" = "My Medals";
|
||||
"20.20.61_text_2" = "Wearing";
|
||||
"20.20.61_text_3" = "Task Medals";
|
||||
"20.20.61_text_4" = "Activity Medals";
|
||||
"20.20.61_text_5" = "Glory Medals";
|
||||
"20.20.61_text_6" = "You are not wearing any medals";
|
||||
"20.20.61_text_7" = "You have not received any medals Go to the medal square and check it out!";
|
||||
"20.20.61_text_8" = "Expiration time:%@";
|
||||
"20.20.61_text_9" = "Forever";
|
||||
|