删除不再使用的资源文件,包括多个图像集和其对应的 Contents.json 文件,更新 MedalsModel.h 和 MedalsModel.m 以支持使用勋章的类型,新增 MedalsCyclePagerCell 组件以优化勋章展示,保持代码结构一致性。

This commit is contained in:
edwinQQQ
2025-06-23 16:36:39 +08:00
parent f62af24c48
commit c0500397b6
96 changed files with 383 additions and 1104 deletions

View File

@@ -156,7 +156,6 @@
2331C1672A5EB71000E1D940 /* NobleLevelUpModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C13C2A5EB71000E1D940 /* NobleLevelUpModel.m */; };
2331C1682A5EB71000E1D940 /* NobleAuthInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C13D2A5EB71000E1D940 /* NobleAuthInfo.m */; };
2331C1692A5EB71000E1D940 /* XPNobleSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1412A5EB71000E1D940 /* XPNobleSettingViewController.m */; };
2331C16B2A5EB71000E1D940 /* XPNobleCenterMyNobleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1482A5EB71000E1D940 /* XPNobleCenterMyNobleView.m */; };
2331C16C2A5EB71000E1D940 /* XPNobleCenterEmptyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C14C2A5EB71000E1D940 /* XPNobleCenterEmptyView.m */; };
2331C16D2A5EB71000E1D940 /* XPNobleSettingNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1522A5EB71000E1D940 /* XPNobleSettingNavView.m */; };
2331C16E2A5EB71000E1D940 /* XPNobleAuthorityDescView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1532A5EB71000E1D940 /* XPNobleAuthorityDescView.m */; };
@@ -517,6 +516,7 @@
4C6E1F7C2CEB25B10073D0A3 /* ShoppingMallItemPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F7B2CEB25B10073D0A3 /* ShoppingMallItemPreview.m */; };
4C6E31EC2D35010F00D8EEDD /* RoomAnimationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E31EB2D35010F00D8EEDD /* RoomAnimationView.m */; };
4C6E31EE2D363CA800D8EEDD /* addMoveAnimationToView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E31ED2D363CA800D8EEDD /* addMoveAnimationToView.m */; };
4C7153952E0942F700C9F940 /* MedalsCyclePagerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7153942E0942F700C9F940 /* MedalsCyclePagerCell.m */; };
4C71C69F2D069D2B00ECCA24 /* GiftAnimationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C71C69E2D069D2B00ECCA24 /* GiftAnimationHelper.m */; };
4C71C6A22D06DB3D00ECCA24 /* GiftAnimationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C71C6A12D06DB3D00ECCA24 /* GiftAnimationManager.m */; };
4C75CEFB2D6318FF009147A5 /* RoomEnterModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C75CEFA2D6318FF009147A5 /* RoomEnterModel.m */; };
@@ -2015,7 +2015,6 @@
2331C1432A5EB71000E1D940 /* XPNobleCenterListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterListViewController.h; sourceTree = "<group>"; };
2331C1462A5EB71000E1D940 /* XPNobleAuthorityDescView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleAuthorityDescView.h; sourceTree = "<group>"; };
2331C1472A5EB71000E1D940 /* XPNobleSettingNavView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleSettingNavView.h; sourceTree = "<group>"; };
2331C1482A5EB71000E1D940 /* XPNobleCenterMyNobleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterMyNobleView.m; sourceTree = "<group>"; };
2331C14A2A5EB71000E1D940 /* XPNobleCenterTableHeadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterTableHeadView.h; sourceTree = "<group>"; };
2331C14B2A5EB71000E1D940 /* XPNoblePrivilegeContentCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNoblePrivilegeContentCell.h; sourceTree = "<group>"; };
2331C14C2A5EB71000E1D940 /* XPNobleCenterEmptyView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterEmptyView.m; sourceTree = "<group>"; };
@@ -2023,7 +2022,6 @@
2331C14E2A5EB71000E1D940 /* XPNobleUpgradeLevelView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleUpgradeLevelView.h; sourceTree = "<group>"; };
2331C14F2A5EB71000E1D940 /* XPNobleCenterResidueView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterResidueView.h; sourceTree = "<group>"; };
2331C1502A5EB71000E1D940 /* XPNoblePrivilegeCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNoblePrivilegeCell.h; sourceTree = "<group>"; };
2331C1512A5EB71000E1D940 /* XPNobleCenterMyNobleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterMyNobleView.h; sourceTree = "<group>"; };
2331C1522A5EB71000E1D940 /* XPNobleSettingNavView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPNobleSettingNavView.m; sourceTree = "<group>"; };
2331C1532A5EB71000E1D940 /* XPNobleAuthorityDescView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPNobleAuthorityDescView.m; sourceTree = "<group>"; };
2331C1542A5EB71000E1D940 /* XPNobleCenterNavView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterNavView.m; sourceTree = "<group>"; };
@@ -2702,6 +2700,8 @@
4C6E31EA2D35010F00D8EEDD /* RoomAnimationView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomAnimationView.h; sourceTree = "<group>"; };
4C6E31EB2D35010F00D8EEDD /* RoomAnimationView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomAnimationView.m; sourceTree = "<group>"; };
4C6E31ED2D363CA800D8EEDD /* addMoveAnimationToView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = addMoveAnimationToView.m; sourceTree = "<group>"; };
4C7153932E0942F700C9F940 /* MedalsCyclePagerCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MedalsCyclePagerCell.h; sourceTree = "<group>"; };
4C7153942E0942F700C9F940 /* MedalsCyclePagerCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MedalsCyclePagerCell.m; sourceTree = "<group>"; };
4C71C69D2D069D2B00ECCA24 /* GiftAnimationHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftAnimationHelper.h; sourceTree = "<group>"; };
4C71C69E2D069D2B00ECCA24 /* GiftAnimationHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftAnimationHelper.m; sourceTree = "<group>"; };
4C71C6A02D06DB3D00ECCA24 /* GiftAnimationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftAnimationManager.h; sourceTree = "<group>"; };
@@ -5945,8 +5945,6 @@
2331C1532A5EB71000E1D940 /* XPNobleAuthorityDescView.m */,
2331C1552A5EB71000E1D940 /* XPNobleCenterEmptyView.h */,
2331C14C2A5EB71000E1D940 /* XPNobleCenterEmptyView.m */,
2331C1512A5EB71000E1D940 /* XPNobleCenterMyNobleView.h */,
2331C1482A5EB71000E1D940 /* XPNobleCenterMyNobleView.m */,
2331C14D2A5EB71000E1D940 /* XPNobleCenterNavView.h */,
2331C1542A5EB71000E1D940 /* XPNobleCenterNavView.m */,
2331C14F2A5EB71000E1D940 /* XPNobleCenterResidueView.h */,
@@ -6862,6 +6860,8 @@
4C886BE42E013BF7006F0BA7 /* Medals */ = {
isa = PBXGroup;
children = (
4C7153932E0942F700C9F940 /* MedalsCyclePagerCell.h */,
4C7153942E0942F700C9F940 /* MedalsCyclePagerCell.m */,
4C886BE62E013C55006F0BA7 /* MedalsViewController.h */,
4C886BE72E013C55006F0BA7 /* MedalsViewController.m */,
4C0A5B822E02675300955219 /* MedalsCollectionViewCell.h */,
@@ -12550,6 +12550,7 @@
E87E63F729AA1A5600EBE52B /* YuMi.xcdatamodeld in Sources */,
9BE01ACE28925F7D00B50299 /* XPMineNewUserRechargeView.m in Sources */,
E83ABF03280EC90C00322EE4 /* ContentApplicationShareModel.m in Sources */,
4C7153952E0942F700C9F940 /* MedalsCyclePagerCell.m in Sources */,
9BA812E028BF6ABB00783EA7 /* Api+RedPacket.m in Sources */,
9BA3B40F293DD2F90071DF1C /* XPUpgradeView.m in Sources */,
E81A654928351B9500F55894 /* XPMomentsRecommendHeaderView.m in Sources */,
@@ -12843,7 +12844,6 @@
E81D58822720082A003063FE /* MicroWaveView.m in Sources */,
E8A73F8728586A6F00FD9CBC /* XPGiftWeekStarCollectionViewCell.m in Sources */,
E80E09B62A42078F00CD2BE7 /* XPRoomStarKitchenModel.m in Sources */,
2331C16B2A5EB71000E1D940 /* XPNobleCenterMyNobleView.m in Sources */,
E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */,
E878B85B2835F3BF00E22DCF /* XPMonentsInteractiveTableViewCell.m in Sources */,
9BCFB828289BAC7D0093D863 /* XPMineHeadFunctionItemLayout.m in Sources */,

View File

@@ -1,6 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mine_dressup_noble_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mine_dressup_noble_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "noble_privilege_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "noble_privilege_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

View File

@@ -1,6 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -5,7 +5,6 @@
"scale" : "1x"
},
{
"filename" : "room_across_pk_invite_result_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -1,6 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,21 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailiing_enter.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_add@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_add@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_animation_gift_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_animation_gift_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_buy_fuel_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_buy_fuel_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_buy_fuel_cancel@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_buy_fuel_cancel@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_buy_fuel_sure@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_buy_fuel_sure@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_description@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_description@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_explore@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_explore@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_explore_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_explore_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_getfule@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_getfule@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_prize_cowry_large@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_prize_cowry_large@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_prize_crowy@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_prize_crowy@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_prize_normal_large@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_prize_normal_large@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_prize_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_prize_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_rank@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_rank@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_rank_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_rank_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_rank_first@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_rank_first@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_rank_second@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_rank_second@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_rank_third@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_rank_third@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_record@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_record@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_redu@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_redu@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_rule_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_rule_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_sailing@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_sailing@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_tips_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_tips_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_sailing_tips_select@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_sailing_tips_select@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 B

View File

@@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString *nick;
@property (nonatomic, assign) NSInteger uid;
@property (nonatomic, copy) NSArray <MedalSeriesVo *> *medalSeries;
@property (nonatomic, copy) NSArray *useMedals;
@property (nonatomic, copy) NSArray <MedalVo *>*useMedals;
@end

View File

@@ -30,7 +30,8 @@
@implementation UserMedalsModel
+ (NSDictionary *)mj_objectClassInArray {
return @{
@"medalSeries" : [MedalSeriesVo class]
@"medalSeries" : [MedalSeriesVo class],
@"useMedals" : [MedalVo class]
};
}
@end

View File

@@ -0,0 +1,30 @@
//
// MedalsCyclePagerCell.h
// YuMi
//
// Created by P on 2025/1/7.
//
#import <UIKit/UIKit.h>
@class MedalVo;
NS_ASSUME_NONNULL_BEGIN
@interface MedalsCyclePagerCell : UICollectionViewCell
- (void)updateCell:(MedalVo *)model;
/**
* 当 cell 将要显示时调用
* 用于恢复 mp4 播放
*/
- (void)willDisplay;
/**
* 当 cell 结束显示时调用
* 用于暂停 mp4 播放
*/
- (void)didEndDisplaying;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,252 @@
//
// MedalsCyclePagerCell.m
// YuMi
//
// Created by P on 2025/1/7.
//
#import "MedalsCyclePagerCell.h"
#import "MedalsModel.h"
#import <QGVAPWrapView.h>
#import "XPRoomGiftAnimationParser.h"
@interface MedalsCyclePagerCell ()
@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) MedalVo *displayModel;
@property (nonatomic, assign) BOOL isVisible; // cell
@end
@implementation MedalsCyclePagerCell
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self setupUI];
[self setupNotifications];
}
return self;
}
- (instancetype)init {
self = [super init];
if (self) {
[self setupUI];
[self setupNotifications];
}
return self;
}
- (void)setupUI {
self.backgroundColor = [UIColor clearColor];
self.contentView.backgroundColor = [UIColor clearColor];
//
self.imageView = [[NetImageView alloc] init];
self.imageView.contentMode = UIViewContentModeScaleAspectFit;
[self.contentView addSubview:self.imageView];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.contentView);
make.size.mas_equalTo(CGSizeMake(184, 184));
}];
// MP4
[self.contentView addSubview:self.mp4View];
[self.mp4View mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.imageView);
}];
}
- (void)setupNotifications {
//
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(appDidEnterBackground)
name:UIApplicationDidEnterBackgroundNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(appWillEnterForeground)
name:UIApplicationWillEnterForegroundNotification
object:nil];
//
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didReceiveMemoryWarning)
name:UIApplicationDidReceiveMemoryWarningNotification
object:nil];
}
- (void)prepareForReuse {
[super prepareForReuse];
//
[self stopMP4Playback];
// mp4
self.mp4View.hidden = YES;
self.imageView.hidden = NO;
//
self.mp4Path = nil;
self.imagePath = nil;
self.isVisible = NO;
//
self.imageView.image = nil;
}
- (void)updateCell:(MedalVo *)model {
self.displayModel = model;
[self updateDisplayWithCurrentModel];
}
- (void)updateDisplayWithCurrentModel {
if (self.displayModel) {
if ([self.displayModel.picUrl hasSuffix:@"mp4"]) {
[self setMp4Path:self.displayModel.picUrl];
} else {
[self setImagePath:self.displayModel.picUrl];
}
}
}
- (void)setImagePath:(NSString *)imagePath {
// mp4
[self stopMP4Playback];
_imagePath = imagePath;
self.mp4View.hidden = YES;
self.imageView.hidden = NO;
self.imageView.imageUrl = imagePath;
}
- (void)setMp4Path:(NSString *)mp4Path {
// mp4
if ([_mp4Path isEqualToString:mp4Path]) {
return;
}
// mp4
[self stopMP4Playback];
_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]) {
// cell
if (self.isVisible) {
[self.mp4View playHWDMP4:videoUrl repeatCount:-1 delegate:nil];
} else {
// URL
self.mp4View.tag = 1; //
}
}
} failureBlock:^(NSError * _Nullable error) {
NSLog(@"Failed to parse mp4: %@", error);
}];
}
#pragma mark - MP4
- (void)stopMP4Playback {
if (self.mp4View) {
[self.mp4View stopHWDMP4];
self.mp4View.tag = 0; //
}
}
- (void)pauseMP4Playback {
if (self.mp4View && !self.mp4View.hidden) {
[self.mp4View pauseHWDMP4];
}
}
- (void)resumeMP4Playback {
if (self.mp4View && !self.mp4View.hidden && self.mp4Path) {
if (self.mp4View.tag == 1) { //
@kWeakify(self);
[self.mp4Parser parseWithURL:self.mp4Path
completionBlock:^(NSString * _Nullable videoUrl) {
@kStrongify(self);
if (![NSString isEmpty:videoUrl] && self.isVisible) {
[self.mp4View playHWDMP4:videoUrl repeatCount:-1 delegate:nil];
}
} failureBlock:nil];
} else {
[self.mp4View resumeHWDMP4];
}
}
}
#pragma mark -
- (void)willDisplay {
self.isVisible = YES;
[self resumeMP4Playback];
}
- (void)didEndDisplaying {
self.isVisible = NO;
[self pauseMP4Playback];
}
#pragma mark -
- (void)appDidEnterBackground {
[self pauseMP4Playback];
}
- (void)appWillEnterForeground {
if (self.isVisible) {
[self resumeMP4Playback];
}
}
- (void)didReceiveMemoryWarning {
//
if (!self.isVisible) {
[self stopMP4Playback];
}
}
#pragma mark -
- (void)dealloc {
//
[self stopMP4Playback];
//
[[NSNotificationCenter defaultCenter] removeObserver:self];
//
self.mp4Parser = nil;
NSLog(@"MedalsCyclePagerCell dealloc");
}
#pragma mark - Lazy load
- (VAPView *)mp4View {
if (!_mp4View) {
_mp4View = [[VAPView alloc] init];
_mp4View.contentMode = UIViewContentModeScaleAspectFit;
}
return _mp4View;
}
@end

View File

@@ -10,6 +10,7 @@
#import "UserInfoModel.h"
#import "TYCyclePagerView.h"
#import "MedalsCollectionViewCell.h"
#import "MedalsCyclePagerCell.h"
#import "MedalsDetailView.h"
#import "MedalsWearingViewController.h"
#import "MedalsRankViewController.h"
@@ -28,18 +29,20 @@ typedef enum : NSInteger {
MedalsCenterDisplayType_Square
} MedalsCenterDisplayType;
@interface MedalsViewController () <MedalsPresenterProtocol, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
@interface MedalsViewController () <MedalsPresenterProtocol, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, TYCyclePagerViewDataSource, TYCyclePagerViewDelegate>
@property (nonatomic, strong) UserInfoModel *userInfo;
@property (nonatomic, copy) NSArray <UIButton *> *centerTabButtons;
@property (nonatomic, strong) UILabel *medalDescLabel;
@property (nonatomic, strong) UIButton *emptyUserMedalButton;
@property (nonatomic, strong) TYCyclePagerView *medalsCyclePagerView;
@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, copy) NSArray <MedalVo *> *useMedals;
@property (nonatomic, assign) NSInteger currentPageTaskMedals;
@property (nonatomic, assign) NSInteger currentPageActivityMedals;
@@ -110,6 +113,8 @@ typedef enum : NSInteger {
[self setupWearingButton];
if (self.userInfo.medals.medalCount == 0) {
[self setupEmptyUserMedals];
} else {
[self setupWearingUserMedals];
}
} else {
[self setupOthersMedalInfo];
@@ -265,11 +270,19 @@ typedef enum : NSInteger {
}
- (void)setupEmptyUserMedals {
[self.view addSubview:self.medalsCyclePagerView];
[self.view addSubview:self.emptyUserMedalButton];
[self.emptyUserMedalButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(100);
make.width.height.mas_equalTo(184);
make.centerX.mas_equalTo(self.view);
make.size.mas_equalTo(CGSizeMake(184, 184));
make.top.mas_equalTo(100);
}];
[self.medalsCyclePagerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.emptyUserMedalButton);
make.width.mas_equalTo([UIScreen mainScreen].bounds.size.width);
make.height.mas_equalTo(self.emptyUserMedalButton);
}];
[self.view addSubview:self.medalDescLabel];
@@ -282,6 +295,15 @@ typedef enum : NSInteger {
}
- (void)setupWearingUserMedals {
// TYCyclePagerView
[self.view addSubview:self.medalsCyclePagerView];
[self.medalsCyclePagerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(100);
make.centerX.mas_equalTo(self.view);
make.width.mas_equalTo([UIScreen mainScreen].bounds.size.width);
make.height.mas_equalTo(184);
}];
[self.view addSubview:self.medalDescLabel];
self.medalDescLabel.text = @"显示过期时间";//YMLocalizedString(@"20.20.61_text_6");
[self.medalDescLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -403,6 +425,7 @@ typedef enum : NSInteger {
[self endReresh];
[self _updateDataSource:userMedalsModel.medalSeries];
[self _updateOtherInfo:userMedalsModel];
[self _updateWearingInfo];
}
- (void)userMedalsFailure {
@@ -463,8 +486,15 @@ typedef enum : NSInteger {
}
- (void)_updateWearingInfo {
self.useMedals = self.userMedalsModel.useMedals;
if (self.displayType != MedalsCenterDisplayType_Other) {
if (self.useMedals.count > 0 ) {
self.emptyUserMedalButton.hidden = YES;
[self.medalsCyclePagerView reloadData];
} else {
self.emptyUserMedalButton.hidden = NO;
self.medalsCyclePagerView.hidden = YES;
}
}
}
@@ -612,6 +642,50 @@ typedef enum : NSInteger {
return model;
}
#pragma mark - TYCyclePagerView DataSource & Delegate
- (NSInteger)numberOfItemsInPagerView:(TYCyclePagerView *)pageView {
return self.useMedals.count;
}
- (__kindof UICollectionViewCell *)pagerView:(TYCyclePagerView *)pagerView cellForItemAtIndex:(NSInteger)index {
MedalsCyclePagerCell *cell = [pagerView dequeueReusableCellWithReuseIdentifier:@"MedalsCyclePagerCell" forIndex:index];
MedalVo *vo = [self.useMedals xpSafeObjectAtIndex:index];
[cell updateCell:vo];
return cell;
}
- (TYCyclePagerViewLayout *)layoutForPagerView:(TYCyclePagerView *)pageView {
TYCyclePagerViewLayout *layout = [[TYCyclePagerViewLayout alloc] init];
layout.itemSize = CGSizeMake(184, 184);
layout.itemSpacing = 10;
layout.layoutType = TYCyclePagerTransformLayoutLinear;
layout.itemHorizontalCenter = YES;
return layout;
}
- (void)pagerView:(TYCyclePagerView *)pageView didScrollFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex {
// cell cell
// cells
NSArray *visibleCells = pageView.collectionView.visibleCells;
// cells index cell
for (UICollectionViewCell *cell in visibleCells) {
if ([cell isKindOfClass:[MedalsCyclePagerCell class]]) {
NSIndexPath *indexPath = [pageView.collectionView indexPathForCell:cell];
if (indexPath) {
NSInteger cellIndex = indexPath.item;
if (cellIndex == toIndex) {
[(MedalsCyclePagerCell *)cell willDisplay];
} else {
[(MedalsCyclePagerCell *)cell didEndDisplaying];
}
}
}
}
}
#pragma mark - Lazy load
- (UIButton *)medalsSquareButton {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -767,4 +841,18 @@ typedef enum : NSInteger {
return _otherAvatar;
}
- (TYCyclePagerView *)medalsCyclePagerView {
if (!_medalsCyclePagerView) {
_medalsCyclePagerView = [[TYCyclePagerView alloc] init];
_medalsCyclePagerView.dataSource = self;
_medalsCyclePagerView.delegate = self;
_medalsCyclePagerView.backgroundColor = [UIColor clearColor];
_medalsCyclePagerView.isInfiniteLoop = NO;
_medalsCyclePagerView.clipsToBounds = NO;
[_medalsCyclePagerView registerClass:[MedalsCyclePagerCell class]
forCellWithReuseIdentifier:@"MedalsCyclePagerCell"];
}
return _medalsCyclePagerView;
}
@end

View File

@@ -1,31 +0,0 @@
//
// XPNobleCenterMyNobleView.h
// xplan-ios
//
// Created by GreenLand on 2022/1/4.
//
#import <UIKit/UIKit.h>
#import "NobleCenterModel.h"
#import "RechargeListModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol XPNobleCenterMyNobleViewDelegate <NSObject>
-(void)payNobleCenterWithModel:(RechargeListModel *)rechargeModel vipInfo:(NobleInfo *)vipInfo ;
@end
@interface XPNobleCenterMyNobleView : UIView
///总数据
@property (nonatomic, strong) NobleCenterModel *model;
@property(nonatomic,strong) NobleInfo *vipInfo;
@property(nonatomic,strong) RechargeListModel *rechargeModel;
@property(nonatomic,weak) id<XPNobleCenterMyNobleViewDelegate>delegate;
@property(nonatomic,assign) BOOL isHiddenPayBtn;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,427 +0,0 @@
//
// XPNobleCenterMyNobleView.m
// xplan-ios
//
// Created by GreenLand on 2022/1/4.
//
#import "XPNobleCenterMyNobleView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor+NobleCenter.h"
#import "UIImage+Utils.h"
#import "TTPopup.h"
#import "XPNobleCenterResidueView.h"
@interface XPNobleCenterMyNobleView ()
///view
@property (nonatomic, strong) UIView *topView;
///
@property (nonatomic, strong) YYLabel *nobleLabel;
///
@property (nonatomic, strong) UIButton *timeDescButton;
///
@property (nonatomic, strong) UIImageView *privilegeIconImage;
///
@property (nonatomic, strong) UIView *backProgressView;
///
@property (nonatomic, strong) UIImageView *currentProgressView;
///
@property (nonatomic, strong) UIImageView *indicateImageView;
///
@property (nonatomic, strong) UIImageView *safeLevelImageView;
///
@property (nonatomic, strong) UILabel *currentValueLabel;
///
@property (nonatomic, strong) UILabel *safeValueLabel;
///
@property (nonatomic, strong) UILabel *upGradeValueLabel;
///VIP
@property (nonatomic, strong) UILabel *openNobleButton;
///
@property (nonatomic,strong) UIImageView *openNobleView;
@property (nonatomic,strong) UIImageView *openNobleIconView;
@end
@implementation XPNobleCenterMyNobleView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = UIColorFromRGB(0x252014);
[self addSubview:self.topView];
[self.topView addSubview:self.nobleLabel];
[self.topView addSubview:self.timeDescButton];
[self addSubview:self.privilegeIconImage];
[self addSubview:self.backProgressView];
[self.backProgressView addSubview:self.currentProgressView];
[self addSubview:self.indicateImageView];
[self addSubview:self.safeLevelImageView];
[self addSubview:self.currentValueLabel];
[self addSubview:self.safeValueLabel];
[self addSubview:self.upGradeValueLabel];
[self addSubview:self.openNobleView];
[self.openNobleView addSubview:self.openNobleIconView];
[self.openNobleView addSubview:self.openNobleButton];
}
- (void)initSubViewConstraints {
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.leading.trailing.mas_equalTo(0);
make.height.mas_greaterThanOrEqualTo(36);
}];
CGFloat width = KScreenWidth - 29 - 15;
[self.nobleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(15);
make.top.bottom.equalTo(self.topView);
make.width.mas_lessThanOrEqualTo(width);
}];
[self.timeDescButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.topView);
make.leading.mas_equalTo(self.nobleLabel.mas_trailing).mas_offset(3);
make.width.height.mas_equalTo(14);
}];
[self.privilegeIconImage mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(14);
make.top.mas_equalTo(self.topView.mas_bottom).mas_offset(24);
make.width.mas_equalTo(50);
make.height.mas_equalTo(16);
}];
[self.backProgressView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.privilegeIconImage);
make.leading.mas_equalTo(self.privilegeIconImage.mas_trailing).mas_offset(12);
make.trailing.mas_equalTo(-14);
make.height.mas_equalTo(12);
}];
[self.currentProgressView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.top.bottom.mas_equalTo(self.backProgressView);
make.trailing.mas_equalTo(self.indicateImageView.mas_centerX);
}];
[self.indicateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.backProgressView);
make.width.height.mas_equalTo(18);
make.centerX.mas_equalTo(self.backProgressView.mas_leading).mas_offset(2);
}];
[self.currentValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.indicateImageView).priorityMedium();
make.top.mas_equalTo(self.backProgressView.mas_bottom).mas_offset(5);
make.trailing.mas_lessThanOrEqualTo(-12).priorityHigh();
}];
[self.safeValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.safeLevelImageView.mas_top).mas_offset(-2);
make.height.mas_equalTo(10);
}];
[self.safeLevelImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.backProgressView.mas_top).mas_offset(2);
make.centerX.mas_equalTo(self.safeValueLabel);
make.width.height.mas_equalTo(8);
}];
[self.upGradeValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.safeValueLabel);
make.trailing.mas_equalTo(self.backProgressView);
}];
[self.openNobleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.bottom.mas_equalTo(-kSafeAreaBottomHeight - 5);
make.width.mas_equalTo(300);
make.height.mas_equalTo(44);
}];
[self.openNobleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_lessThanOrEqualTo(258);
make.centerX.equalTo(self.openNobleView);
make.top.bottom.equalTo(self.openNobleView);
}];
[self.openNobleIconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
make.centerY.equalTo(self.openNobleView);
make.trailing.equalTo(self.openNobleButton.mas_leading).mas_offset(-2);
}];
}
#pragma mark - private
- (NSMutableAttributedString *)createNobleStringWithModel:(NobleCenterModel *)model {
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init];
[string appendAttributedString:[self createAttribute:YMLocalizedString(@"XPNobleCenterMyNobleView0") color:[DJDKMIMOMColor normalNobleTextColor]]];
NSString *levelName = @"";
NSInteger distanceValue = 0;
NSString *nextLevelName = @"";
NSInteger saveScore = 0;
NSInteger nextSecore = 0;
BOOL hadNextLevel = YES;//
for (NobleInfo *info in model.vipInfos) {
if (info.vipLevel == model.currentLevel) {
levelName = info.vipName;
saveScore = info.levelKeepScore;
nextSecore = info.levelUpScore;
distanceValue = info.levelUpScore - model.currScore;
}
if (info.vipLevel > model.currentLevel && hadNextLevel) {
hadNextLevel = NO;
nextLevelName = info.vipName;
}
}
NSAttributedString *levelStr = [[NSAttributedString alloc] initWithString:levelName attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[DJDKMIMOMColor hightNobleLightTextColor]}];
[string appendAttributedString:levelStr];
if (model.isMaxLevel) {
[string appendAttributedString:[self createAttribute:YMLocalizedString(@"XPNobleCenterMyNobleView1") color:[DJDKMIMOMColor normalNobleTextColor]]];
} else {
[string appendAttributedString:[self createAttribute:YMLocalizedString(@"XPNobleCenterMyNobleView2") color:[DJDKMIMOMColor normalNobleTextColor]]];
NSAttributedString *distanceStr = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%zd", distanceValue] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13], NSForegroundColorAttributeName:[DJDKMIMOMColor hightNobleLightTextColor]}];
[string appendAttributedString:distanceStr];
[string appendAttributedString:[self createAttribute:YMLocalizedString(@"XPNobleCenterMyNobleView3") color:[DJDKMIMOMColor normalNobleTextColor]]];
[string appendAttributedString:[self createAttribute:nextLevelName color:[DJDKMIMOMColor normalNobleTextColor]]];
}
[string appendAttributedString:[self createAttribute:YMLocalizedString(@"XPNobleCenterMyNobleView4") color:[DJDKMIMOMColor normalNobleTextColor]]];
NSAttributedString *countTimeStr = [[NSAttributedString alloc] initWithString:[self cacularTimeWithSecond:model.remainSeconds] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13], NSForegroundColorAttributeName:[DJDKMIMOMColor hightNobleLightTextColor]}];
[string appendAttributedString:countTimeStr];
NSTextAttachment * attachment = [[NSTextAttachment alloc] init];
attachment.bounds = CGRectMake(0, 0, 10, 12);
attachment.image = [UIImage imageNamed:@"noble_indicate_icon"];
NSAttributedString * starAttribute = [NSMutableAttributedString attributedStringWithAttachment:(NSTextAttachment *)attachment];
[string appendAttributedString:starAttribute];
return string;
}
- (NSAttributedString *)createAttribute:(NSString * )text color:(UIColor *)color {
NSDictionary * attribute = @{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:color};
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:attribute];
return attr;
}
- (NSString *)cacularTimeWithSecond:(long long)second {
long long minSecond = 60;
long long hourSecond = minSecond * 60;
long long daySecond = hourSecond * 24;
NSString *day = @"";
NSString *hour = @"";
if (second > daySecond) {
day = [NSString stringWithFormat:@"%lld%@", second / daySecond, YMLocalizedString(@"App_Commont_Day")];
if (second % daySecond > hourSecond) {
hour = [NSString stringWithFormat:YMLocalizedString(@"XPNobleCenterMyNobleView5"), (second % daySecond) / hourSecond];
return [NSString stringWithFormat:@"%@%@", day, hour];
}else {
return day;
}
} else if (second > hourSecond) {
return hour = [NSString stringWithFormat:YMLocalizedString(@"XPNobleCenterMyNobleView6"), second / hourSecond];
} else {
return YMLocalizedString(@"XPNobleCenterMyNobleView7");
}
}
#pragma mark - events
- (void)onTimeButtonClick:(UIButton *)button {
XPNobleCenterResidueView *alertView = [[XPNobleCenterResidueView alloc] initWithFrame:CGRectMake(0, 0, 300, 286)];
TTPopupService * config = [[TTPopupService alloc] init];
config.shouldDismissOnBackgroundTouch = NO;
config.contentView = alertView;
[TTPopup popupWithConfig:config];
}
#pragma mark - Getters And Setters
- (void)setModel:(NobleCenterModel *)model {
_model = model;
self.nobleLabel.attributedText = [self createNobleStringWithModel:model];
NSInteger safeScore = 0;
NSInteger nextScore = 0;
for (NobleInfo *info in model.vipInfos) {
if (info.vipLevel == model.currentLevel) {
safeScore = info.levelKeepScore;
nextScore = info.levelUpScore;
}
}
self.safeValueLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPNobleCenterMyNobleView8"), safeScore];
self.upGradeValueLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPNobleCenterMyNobleView9"), nextScore];
self.currentValueLabel.text = [NSString stringWithFormat:YMLocalizedString(@"XPNobleCenterMyNobleView10"), model.currScore];
CGFloat margin = self.backProgressView.frame.size.width * (model.currScore * 1.0 / nextScore);
if (nextScore == 0) {
margin = 0;
}
[self.indicateImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.backProgressView.mas_leading).mas_offset(margin);
}];
CGFloat safeMargin = self.backProgressView.frame.size.width * (safeScore * 1.0 / nextScore);
if (nextScore == 0) {
safeMargin = 0;
}
[self.safeValueLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.backProgressView.mas_leading).mas_offset(safeMargin);
}];
self.upGradeValueLabel.hidden = model.isMaxLevel;
}
- (void)setVipInfo:(NobleInfo *)vipInfo{
_vipInfo = vipInfo;
if (_vipInfo.vipLevel > _model.currentLevel){
self.openNobleView.hidden = NO;
self.openNobleButton.text = [NSString stringWithFormat:YMLocalizedString(@"XPNobleCenterMyNobleView11"),_rechargeModel.money.floatValue,_vipInfo.vipName];
}else{
self.openNobleView.hidden = YES;
}
}
- (void)setIsHiddenPayBtn:(BOOL)isHiddenPayBtn{
_isHiddenPayBtn = isHiddenPayBtn;
self.openNobleView.hidden = _isHiddenPayBtn;
}
-(void)onOpenNobleButtonClick{
if (self.delegate && [self.delegate respondsToSelector:@selector(payNobleCenterWithModel:vipInfo:)]){
[self.delegate payNobleCenterWithModel:self.rechargeModel vipInfo:self.vipInfo];
}
}
- (UIView *)topView {
if (!_topView) {
_topView = [[UIView alloc] init];
_topView.backgroundColor = UIColorFromRGB(0x302B20);
}
return _topView;
}
- (YYLabel *)nobleLabel {
if (!_nobleLabel) {
_nobleLabel = [[YYLabel alloc] init];
_nobleLabel.textAlignment = NSTextAlignmentCenter;
_nobleLabel.numberOfLines = 0;
}
return _nobleLabel;
}
- (UIImageView *)privilegeIconImage {
if (!_privilegeIconImage) {
_privilegeIconImage = [[UIImageView alloc] initWithImage:[UIImage getLanguageImage:@"noble_privilege_icon"]];
}
return _privilegeIconImage;
}
- (UIView *)backProgressView {
if (!_backProgressView) {
_backProgressView = [[UIView alloc] init];
_backProgressView.backgroundColor = UIColorFromRGB(0x443A24);
_backProgressView.layer.cornerRadius = 6;
_backProgressView.layer.masksToBounds = YES;
_backProgressView.layer.borderColor = UIColorFromRGB(0xB49158).CGColor;
_backProgressView.layer.borderWidth = 0.5;
}
return _backProgressView;
}
- (UIImageView *)currentProgressView {
if (!_currentProgressView) {
_currentProgressView = [[UIImageView alloc] init];
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xF2B04E),UIColorFromRGB(0xFFE5BA)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(12, 12)];
_currentProgressView.image = image;
}
return _currentProgressView;
}
- (UIImageView *)indicateImageView {
if (!_indicateImageView) {
_indicateImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"noble_indicate_icon"]];
}
return _indicateImageView;
}
- (UIImageView *)safeLevelImageView {
if (!_safeLevelImageView) {
_safeLevelImageView = [[UIImageView alloc] init];
_safeLevelImageView.image = [UIImage imageNamed:@"noble_safe_level_arrow"];
}
return _safeLevelImageView;
}
- (UILabel *)currentValueLabel {
if (!_currentValueLabel) {
_currentValueLabel = [[UILabel alloc] init];
_currentValueLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
// _currentValueLabel.textAlignment = NSTextAlignmentCenter;
_currentValueLabel.text = @"0";
_currentValueLabel.textColor = [DJDKMIMOMColor hightNobleLightTextColor];
}
return _currentValueLabel;
}
- (UILabel *)safeValueLabel {
if (!_safeValueLabel) {
_safeValueLabel = [[UILabel alloc] init];
_safeValueLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_safeValueLabel.textAlignment = NSTextAlignmentCenter;
_safeValueLabel.text = @"0";
_safeValueLabel.textColor = [DJDKMIMOMColor normalNobleTextColor];
}
return _safeValueLabel;
}
- (UILabel *)upGradeValueLabel {
if (!_upGradeValueLabel) {
_upGradeValueLabel = [[UILabel alloc] init];
_upGradeValueLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_upGradeValueLabel.textAlignment = NSTextAlignmentCenter;
_upGradeValueLabel.text = @"0";
_upGradeValueLabel.textColor = [DJDKMIMOMColor normalNobleTextColor];
}
return _upGradeValueLabel;
}
- (UIButton *)timeDescButton {
if (!_timeDescButton) {
_timeDescButton = [[UIButton alloc] init];
[_timeDescButton setBackgroundImage:[UIImage imageNamed:@"noble_time_help"] forState:UIControlStateNormal];
[_timeDescButton addTarget:self action:@selector(onTimeButtonClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _timeDescButton;
}
- (UIImageView *)openNobleView{
if (!_openNobleView){
_openNobleView = [UIImageView new];
_openNobleView.image = kImage(@"noble_open_btn_bg");
_openNobleView.userInteractionEnabled = YES;
_openNobleView.hidden = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(onOpenNobleButtonClick)];
[_openNobleView addGestureRecognizer:tap];
}
return _openNobleView;
}
- (UILabel *)openNobleButton {
if (!_openNobleButton) {
NSString *title = [NSString stringWithFormat:YMLocalizedString(@"XPNobleCenterViewController0"), @"2.99"];
_openNobleButton = [UILabel new];
_openNobleButton.text = title;
_openNobleButton.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
_openNobleButton.textColor = [DJDKMIMOMColor mainTextColor];
_openNobleButton.numberOfLines = 0;
_openNobleButton.textAlignment = NSTextAlignmentCenter;
}
return _openNobleButton;
}
-(UIImageView *)openNobleIconView{
if (!_openNobleIconView){
_openNobleIconView = [UIImageView new];
_openNobleIconView.image = kImage(@"noble_open_btn");
}
return _openNobleIconView;
}
@end