diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 22acd12d..447d1ad8 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -164,7 +164,6 @@ 9B39C88C28855ECA00564D17 /* XPHomeLivePageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B39C88B28855ECA00564D17 /* XPHomeLivePageViewController.m */; }; 9B3A1DF4280571000058E2DD /* XPAnchorPKInviteView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3A1DF3280571000058E2DD /* XPAnchorPKInviteView.m */; }; 9B41D36E282649230048C588 /* XPWeekStarRankUserModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B41D36D282649230048C588 /* XPWeekStarRankUserModel.m */; }; - 9B41D37128264E320048C588 /* XPWeekStarInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B41D37028264E320048C588 /* XPWeekStarInfoView.m */; }; 9B42868E28C1AE2D009034D2 /* XPReceiveRedPacketView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B42868D28C1AE2D009034D2 /* XPReceiveRedPacketView.m */; }; 9B42869228C1AED4009034D2 /* XPReceiveRedPacketModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B42869128C1AED4009034D2 /* XPReceiveRedPacketModel.m */; }; 9B42869528C1E00A009034D2 /* XPRedPacketResultModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B42869428C1E00A009034D2 /* XPRedPacketResultModel.m */; }; @@ -173,6 +172,8 @@ 9B46B91728DDA893000E30DB /* XPHomeRedommendCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B46B91628DDA893000E30DB /* XPHomeRedommendCollectionViewCell.m */; }; 9B4769AD28DB270F00CCD312 /* XPHomePartyNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4769AC28DB270F00CCD312 /* XPHomePartyNavView.m */; }; 9B4D148127E485EB000AA0C1 /* XPRoomTrumpetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4D148027E485EB000AA0C1 /* XPRoomTrumpetView.m */; }; + 9B4D449328F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4D449228F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m */; }; + 9B4D449628F15EE7002572D5 /* XPGiftWeekStarBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4D449528F15EE7002572D5 /* XPGiftWeekStarBroadcastView.m */; }; 9B4E920028E57A620033419E /* XPGiftHeadTypeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4E91FF28E57A620033419E /* XPGiftHeadTypeView.m */; }; 9B53D57A28E2CF18005187A3 /* XPTeenagerHomeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B53D57928E2CF18005187A3 /* XPTeenagerHomeView.m */; }; 9B5BF8A827E1BED1005DD346 /* Api+RoomTrumpet.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B5BF8A727E1BED1005DD346 /* Api+RoomTrumpet.m */; }; @@ -1501,8 +1502,6 @@ 9B3A1DF3280571000058E2DD /* XPAnchorPKInviteView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorPKInviteView.m; sourceTree = ""; }; 9B41D36C282649230048C588 /* XPWeekStarRankUserModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPWeekStarRankUserModel.h; sourceTree = ""; }; 9B41D36D282649230048C588 /* XPWeekStarRankUserModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPWeekStarRankUserModel.m; sourceTree = ""; }; - 9B41D36F28264E320048C588 /* XPWeekStarInfoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPWeekStarInfoView.h; sourceTree = ""; }; - 9B41D37028264E320048C588 /* XPWeekStarInfoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPWeekStarInfoView.m; sourceTree = ""; }; 9B42868C28C1AE2D009034D2 /* XPReceiveRedPacketView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPReceiveRedPacketView.h; sourceTree = ""; }; 9B42868D28C1AE2D009034D2 /* XPReceiveRedPacketView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPReceiveRedPacketView.m; sourceTree = ""; }; 9B42869028C1AED4009034D2 /* XPReceiveRedPacketModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPReceiveRedPacketModel.h; sourceTree = ""; }; @@ -1519,6 +1518,10 @@ 9B4769AC28DB270F00CCD312 /* XPHomePartyNavView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomePartyNavView.m; sourceTree = ""; }; 9B4D147F27E485EB000AA0C1 /* XPRoomTrumpetView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTrumpetView.h; sourceTree = ""; }; 9B4D148027E485EB000AA0C1 /* XPRoomTrumpetView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTrumpetView.m; sourceTree = ""; }; + 9B4D449128F15765002572D5 /* XPGiftLuckyGiftBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftLuckyGiftBroadcastView.h; sourceTree = ""; }; + 9B4D449228F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftLuckyGiftBroadcastView.m; sourceTree = ""; }; + 9B4D449428F15EE7002572D5 /* XPGiftWeekStarBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftWeekStarBroadcastView.h; sourceTree = ""; }; + 9B4D449528F15EE7002572D5 /* XPGiftWeekStarBroadcastView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftWeekStarBroadcastView.m; sourceTree = ""; }; 9B4E91FE28E57A620033419E /* XPGiftHeadTypeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftHeadTypeView.h; sourceTree = ""; }; 9B4E91FF28E57A620033419E /* XPGiftHeadTypeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftHeadTypeView.m; sourceTree = ""; }; 9B53D57828E2CF18005187A3 /* XPTeenagerHomeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPTeenagerHomeView.h; sourceTree = ""; }; @@ -6630,10 +6633,12 @@ E8788947273A55D000BF1D57 /* XPGiftBarView.m */, E890BC0B273D09A50007C46B /* XPGiftCountView.h */, E890BC0C273D09A50007C46B /* XPGiftCountView.m */, - 9B41D36F28264E320048C588 /* XPWeekStarInfoView.h */, - 9B41D37028264E320048C588 /* XPWeekStarInfoView.m */, E8901CF428B38D89001E9A92 /* XPGraffitiGiftView.h */, E8901CF528B38D89001E9A92 /* XPGraffitiGiftView.m */, + 9B4D449128F15765002572D5 /* XPGiftLuckyGiftBroadcastView.h */, + 9B4D449228F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m */, + 9B4D449428F15EE7002572D5 /* XPGiftWeekStarBroadcastView.h */, + 9B4D449528F15EE7002572D5 /* XPGiftWeekStarBroadcastView.m */, ); path = View; sourceTree = ""; @@ -9535,6 +9540,7 @@ E8ACEFF527C8EF0500F66D1A /* XPHomeHotRoomViewController.m in Sources */, E8E20BE828169BDC0033B688 /* XPMineLoginPasswordPresenter.m in Sources */, E81EF6DC279AB5CC00FF3EDE /* XPLittleGameRoomOpenView.m in Sources */, + 9B4D449628F15EE7002572D5 /* XPGiftWeekStarBroadcastView.m in Sources */, E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */, 9B1EF3D227E81C0600554295 /* XPMineDressUpBubbleViewController.m in Sources */, E8A1E4512762082A00B294CA /* Api+CandyTree.m in Sources */, @@ -9652,6 +9658,7 @@ 186A534626FC6ED900D67B2C /* TTPopup.m in Sources */, E81EF6E0279AB7D900FF3EDE /* XPCreateLittleGameCollectionViewCell.m in Sources */, E8C167302806C01500ECB15C /* GuildSuperAdminInfoModel.m in Sources */, + 9B4D449328F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m in Sources */, E81C278C26EAFAF60031E639 /* Base64.m in Sources */, E8C1CD7027D894B800376F83 /* RoomFaceTitleItemModel.m in Sources */, 189DD73D26E21C3F00AB55B1 /* YYUtility+Device.m in Sources */, @@ -9663,7 +9670,6 @@ E877A7EE278428FB00EFACED /* MicroDatingProgressView.m in Sources */, E8E0DAE9285C2E8C00566A2F /* FindNewGreetMessageModel.m in Sources */, E8C6FFE32754F349004DC9F0 /* XPSearchListTableViewCell.m in Sources */, - 9B41D37128264E320048C588 /* XPWeekStarInfoView.m in Sources */, E87A27032758BC81002DDC7A /* XPRoomSearchContainerViewController.m in Sources */, E884C3722743AEDE00E1EBED /* CustomAttachmentDecoder.m in Sources */, 18EE3FEE2750CE6D00A452BF /* NIMMessageUtils.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/Contents.json b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/Contents.json new file mode 100644 index 00000000..ddb69cd5 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_lucky_broadcast_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_lucky_broadcast_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/gift_lucky_broadcast_bg@2x.png b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/gift_lucky_broadcast_bg@2x.png new file mode 100644 index 00000000..f6ab6ed2 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/gift_lucky_broadcast_bg@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/gift_lucky_broadcast_bg@3x.png b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/gift_lucky_broadcast_bg@3x.png new file mode 100644 index 00000000..383d36c2 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_bg.imageset/gift_lucky_broadcast_bg@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/Contents.json new file mode 100644 index 00000000..5b03f22a --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_lucky_broadcast_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_lucky_broadcast_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/gift_lucky_broadcast_icon@2x.png b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/gift_lucky_broadcast_icon@2x.png new file mode 100644 index 00000000..98fdb876 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/gift_lucky_broadcast_icon@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/gift_lucky_broadcast_icon@3x.png b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/gift_lucky_broadcast_icon@3x.png new file mode 100644 index 00000000..296a7845 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_icon.imageset/gift_lucky_broadcast_icon@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/Contents.json new file mode 100644 index 00000000..ab038a8b --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_lucky_broadcast_playType@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_lucky_broadcast_playType@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/gift_lucky_broadcast_playType@2x.png b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/gift_lucky_broadcast_playType@2x.png new file mode 100644 index 00000000..1806c670 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/gift_lucky_broadcast_playType@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/gift_lucky_broadcast_playType@3x.png b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/gift_lucky_broadcast_playType@3x.png new file mode 100644 index 00000000..3f2eb1ab Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftLuckTab/gift_lucky_broadcast_playType.imageset/gift_lucky_broadcast_playType@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/Contents.json b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/Contents.json new file mode 100644 index 00000000..e417b94d --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_weekStar_background@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_weekStar_background@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/gift_weekStar_background@2x.png b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/gift_weekStar_background@2x.png new file mode 100644 index 00000000..9a33a3ee Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/gift_weekStar_background@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/gift_weekStar_background@3x.png b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/gift_weekStar_background@3x.png new file mode 100644 index 00000000..52772eb0 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_background.imageset/gift_weekStar_background@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/Contents.json new file mode 100644 index 00000000..80a2cbbe --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_weekStar_entrance@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_weekStar_entrance@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/gift_weekStar_entrance@2x.png b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/gift_weekStar_entrance@2x.png new file mode 100644 index 00000000..53413405 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/gift_weekStar_entrance@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/gift_weekStar_entrance@3x.png b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/gift_weekStar_entrance@3x.png new file mode 100644 index 00000000..0a8e198c Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/GiftWeekStarTab/gift_weekStar_entrance.imageset/gift_weekStar_entrance@3x.png differ diff --git a/xplan-ios/Base/UI/ThemeColor.h b/xplan-ios/Base/UI/ThemeColor.h index 30b353b7..d661ce30 100644 --- a/xplan-ios/Base/UI/ThemeColor.h +++ b/xplan-ios/Base/UI/ThemeColor.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @interface ThemeColor : NSObject -/// 主题色0xFFBC52 +/// 主题色0x5FCCE4 + (UIColor *)appMainColor; ///强调色 #248CFE + (UIColor *)appEmphasizeColor; diff --git a/xplan-ios/Base/UI/ThemeColor.m b/xplan-ios/Base/UI/ThemeColor.m index 22d12a0a..a820e178 100644 --- a/xplan-ios/Base/UI/ThemeColor.m +++ b/xplan-ios/Base/UI/ThemeColor.m @@ -8,7 +8,7 @@ #import "ThemeColor.h" @implementation ThemeColor -/// 主题色0xFFBC52 +/// 主题色0x5FCCE4 + (UIColor *)appMainColor { return UIColorFromRGB(0x5FCCE4); } diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.h b/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.h index c6e50d8d..cdb9c468 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface ThemeColor (SendGift) /// 没有选择送礼物的人的头像 UIColorRGBAlpha(0x000000, 0.3) + (UIColor *)avatarCoverColor; -/// 送礼物 充值 0xFF903E +/// 送礼物 充值 0xFFB606 + (UIColor *)giftRechargeColor; /// 礼物主背景色 #0B0B0D + (UIColor *)giftBackGroundColor; @@ -20,15 +20,15 @@ NS_ASSUME_NONNULL_BEGIN + (UIColor *)giftBalanceColor; /// 送礼物 分页指示器的颜色 + (UIColor *)giftPageIndicatorColor; -/// 分段控制器文字默认的颜色 #999999 +/// 分段控制器文字默认的颜色 #FFFFFF + (UIColor *)giftSegmentNormalTitleColor; -/// 分段控制器文字选中的颜色 #FFBC51 +/// 分段控制器文字选中的颜色 #5FCCE4 + (UIColor *)giftSegmentSelectTitleColor; -/// 礼物选中的时候的颜色 0xFF903E +/// 礼物选中的时候的颜色 0x5FCCE4 + (UIColor *)giftNameSelectColor; -/// 礼物选中的时候的颜色 0xFF903E 0.65 +/// 礼物选中的时候的颜色 0x5FCCE4 + (UIColor *)giftPriceSelectColor; -/// 礼物价格没有选中的时候的眼色#0B0B0D +/// 礼物价格没有选中的时候的眼色ffffff + (UIColor *)giftPriceNormalColor; /// 礼物选中的覆盖背景 (0x248CFE, 0.2) + (UIColor *)giftSelectBgColor; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.m b/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.m index 95ed9da5..d973d293 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.m @@ -14,47 +14,47 @@ return [UIColor colorWithWhite:0 alpha:0.3]; } -/// 送礼物 充值 0xFF903E +/// 送礼物 充值 0xFFB606 + (UIColor *)giftRechargeColor { - return UIColorFromRGB(0xFF903E); + return UIColorFromRGB(0xFFB606); } /// 礼物主背景色 #0C0B0C + (UIColor *)giftBackGroundColor { - return UIColorRGBAlpha(0x0C0B0C, 0.9); + return UIColorRGBAlpha(0x000000, 0.4); } ///钱包余额信息 0xffffff 0.5 + (UIColor *)giftBalanceColor { - return UIColorRGBAlpha(0xFFFFFF, 0.5); + return UIColorRGBAlpha(0xFFFFFF, 0.35); } /// 送礼物 分页指示器的颜色 + (UIColor *)giftPageIndicatorColor { return [UIColor whiteColor]; } -/// 分段控制器文字默认的颜色 #999999 +/// 分段控制器文字默认的颜色 #FFFFFF + (UIColor *)giftSegmentNormalTitleColor { - return UIColorRGBAlpha(0x999999, 1); + return UIColorRGBAlpha(0xFFFFFF, 1); } -/// 分段控制器文字选中的颜色 #FFBC51 +/// 分段控制器文字选中的颜色 #5FCCE4 + (UIColor *)giftSegmentSelectTitleColor { - return UIColorRGBAlpha(0xFFBC51, 1); + return UIColorRGBAlpha(0x5FCCE4, 1); } -/// 礼物选中的时候的颜色 0xFF903E +/// 礼物选中的时候的颜色 0x#5FCCE4 + (UIColor *)giftNameSelectColor { - return UIColorFromRGB(0xFF903E); + return UIColorFromRGB(0x5FCCE4); } -/// 礼物选中的时候的颜色 0xFF903E 0.65 +/// 礼物选中的时候的颜色 0x5FCCE4 + (UIColor *)giftPriceSelectColor { - return UIColorRGBAlpha(0xFF903E, 0.65); + return UIColorFromRGB(0x5FCCE4); } -/// 礼物价格没有选中的时候的眼色#0B0B0D +/// 礼物价格没有选中的时候的眼色#ffffff + (UIColor *)giftPriceNormalColor { - return UIColorRGBAlpha(0xffffff, 0.5);; + return UIColorRGBAlpha(0xffffff, 1);; } /// 礼物选中的覆盖背景 (0x248CFE, 0.2) + (UIColor *)giftSelectBgColor { - return UIColorRGBAlpha(0x248CFE, 0.2); + return [UIColor clearColor]; } ///玩法规则的图片 7A797A diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m index 22a1ca48..b6ad00d0 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m @@ -228,7 +228,7 @@ - (UILabel *)giftNameLabel { if (!_giftNameLabel) { _giftNameLabel = [[UILabel alloc] init]; - _giftNameLabel.font = [UIFont systemFontOfSize:10]; + _giftNameLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold]; _giftNameLabel.textAlignment = NSTextAlignmentCenter; _giftNameLabel.textColor = [ThemeColor mainTextColor]; } @@ -238,7 +238,7 @@ - (UILabel *)giftNumLabel { if (!_giftNumLabel) { _giftNumLabel = [[UILabel alloc] init]; - _giftNumLabel.font = [UIFont systemFontOfSize:9]; + _giftNumLabel.font = [UIFont systemFontOfSize:10]; _giftNumLabel.textColor = [ThemeColor giftSegmentNormalTitleColor]; } return _giftNumLabel; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m index 85cb9c90..ed68df5c 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m @@ -91,10 +91,12 @@ self.avatarImageView.layer.borderWidth = 2; self.coverView.hidden = YES; self.positionLabel.backgroundColor = [ThemeColor appMainColor]; + _positionLabel.textColor = [ThemeColor mainTextColor]; } else { self.avatarImageView.layer.borderWidth = 0; self.coverView.hidden = NO; self.positionLabel.backgroundColor = [ThemeColor textThirdColor]; + _positionLabel.textColor = [UIColor whiteColor]; } } @@ -127,7 +129,7 @@ _positionLabel.font = [UIFont systemFontOfSize:8]; _positionLabel.textColor = [UIColor whiteColor]; _positionLabel.textAlignment = NSTextAlignmentCenter; - _positionLabel.backgroundColor = [ThemeColor appMainColor]; + _positionLabel.backgroundColor = UIColorFromRGB(0x999999); _positionLabel.layer.masksToBounds = YES; _positionLabel.layer.cornerRadius = 5; } diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftWeekStarCollectionViewCell.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftWeekStarCollectionViewCell.m index 0d479124..aae9b58a 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftWeekStarCollectionViewCell.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/Cell/XPGiftWeekStarCollectionViewCell.m @@ -19,143 +19,11 @@ ///View #import "XPGiftItemCollectionViewCell.h" -@interface XPGiftWeekStarUserView : UIView -///显示头像 -@property (nonatomic,strong) NetImageView *avatarImageView; -///显示昵称 -@property (nonatomic,strong) UILabel *nickLabel; -///显示内容 -@property (nonatomic,strong) UIButton *contentButton; -///上周对应礼物的魅力榜第一 -@property (nonatomic, strong) XPWeekStarRankUserModel *firstCharmRankUser; -///上周对应礼物豪气榜第一 -@property (nonatomic, strong) XPWeekStarRankUserModel *firstLevelRankUser; -@end - -@implementation XPGiftWeekStarUserView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.avatarImageView]; - [self addSubview:self.nickLabel]; - [self addSubview:self.contentButton]; -} - -- (void)initSubViewConstraints { - [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(44, 44)); - make.centerX.mas_equalTo(self); - make.top.mas_equalTo(self).offset(12); - }]; - - [self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self); - make.top.mas_equalTo(self.avatarImageView.mas_bottom).offset(4); - }]; - - [self.contentButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(111, 19)); - make.centerX.mas_equalTo(self); - make.top.mas_equalTo(self.nickLabel.mas_bottom).offset(12); - }]; -} -#pragma mark - Getters And Setters -- (void)setFirstCharmRankUser:(XPWeekStarRankUserModel *)firstCharmRankUser { - _firstCharmRankUser = firstCharmRankUser; - if (_firstCharmRankUser) { - self.avatarImageView.imageUrl = _firstCharmRankUser.avatar; - NSString * nick = _firstCharmRankUser.nick; - if (nick.length > 8) { - nick = [nick substringFromIndex:8]; - } - self.nickLabel.text = nick; - } else { - self.avatarImageView.image = [UIImageConstant defaultEmptyAvatarPlaceholder]; - self.nickLabel.text = @"虚位以待"; - } - self.avatarImageView.layer.borderColor = UIColorFromRGB(0xA563EB).CGColor; - [self.contentButton setBackgroundImage:[UIImage imageNamed:@"gift_info_week_star_charm_bg"] forState:UIControlStateNormal]; - [self.contentButton setTitle:@"本周该礼物冠名者" forState:UIControlStateNormal]; - [self.contentButton setTitleColor:UIColorFromRGB(0x35105C) forState:UIControlStateNormal]; -} - -- (void)setFirstLevelRankUser:(XPWeekStarRankUserModel *)firstLevelRankUser { - _firstLevelRankUser = firstLevelRankUser; - if (_firstLevelRankUser) { - self.avatarImageView.imageUrl = _firstLevelRankUser.avatar; - NSString * nick = _firstLevelRankUser.nick; - if (nick.length > 8) { - nick = [nick substringFromIndex:8]; - } - self.nickLabel.text = nick; - } else { - self.avatarImageView.image = [UIImageConstant defaultEmptyAvatarPlaceholder]; - self.nickLabel.text = @"虚位以待"; - - } - self.avatarImageView.layer.borderColor = UIColorFromRGB(0xFFBC51).CGColor; - [self.contentButton setBackgroundImage:[UIImage imageNamed:@"gift_info_week_star_level_bg"] forState:UIControlStateNormal]; - [self.contentButton setTitle:@"本周该礼物星神豪" forState:UIControlStateNormal]; - [self.contentButton setTitleColor:UIColorFromRGB(0x754304) forState:UIControlStateNormal]; -} - - - -- (NetImageView *)avatarImageView { - if (!_avatarImageView) { - NetImageConfig * config = [[NetImageConfig alloc]init]; - config.imageType = ImageTypeUserIcon; - config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - _avatarImageView = [[NetImageView alloc] initWithConfig:config]; - _avatarImageView.layer.masksToBounds = YES; - _avatarImageView.layer.cornerRadius = 22; - _avatarImageView.layer.borderWidth = 1; - } - return _avatarImageView; -} - -- (UILabel *)nickLabel { - if (!_nickLabel) { - _nickLabel = [[UILabel alloc] init]; - _nickLabel.font = [UIFont systemFontOfSize:10]; - _nickLabel.textColor = [UIColor whiteColor]; - _nickLabel.textAlignment = NSTextAlignmentCenter; - } - return _nickLabel; -} - -- (UIButton *)contentButton { - if (!_contentButton) { - _contentButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _contentButton.titleLabel.font = [UIFont systemFontOfSize:10]; - } - return _contentButton; -} - - -@end - - @interface XPGiftWeekStarCollectionViewCell () ///列表 @property (nonatomic,strong) UICollectionView *collectionView; ///分页 @property (nonatomic,strong) UIPageControl *pageController; -///用户的容器 -@property (nonatomic,strong) UIStackView *userStackView; -///冠名 -@property (nonatomic,strong) XPGiftWeekStarUserView *sendUserView; -///礼物神豪 -@property (nonatomic,strong) XPGiftWeekStarUserView *receiveUserView; ///选中的礼物 @property (nonatomic,strong) GiftInfoModel *selectGiftInfo; @end @@ -174,16 +42,12 @@ - (void)initSubViews { [self.contentView addSubview:self.collectionView]; [self.contentView addSubview:self.pageController]; - [self.contentView addSubview:self.userStackView]; - - [self.userStackView addArrangedSubview:self.sendUserView]; - [self.userStackView addArrangedSubview:self.receiveUserView]; } - (void)initSubViewConstraints { [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.mas_equalTo(self.contentView); - make.height.mas_equalTo(108); + make.height.mas_equalTo(108 * 2); }]; [self.pageController mas_makeConstraints:^(MASConstraintMaker *make) { @@ -191,11 +55,6 @@ make.left.right.mas_equalTo(self.contentView); make.height.mas_equalTo(10); }]; - - [self.userStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.bottom.mas_equalTo(self.contentView); - make.top.mas_equalTo(self.pageController.mas_bottom).offset(0); - }]; } @@ -248,10 +107,10 @@ self.selectGiftInfo = _weekStarGiftList.firstObject; } NSInteger page = 0; - if (_weekStarGiftList.count % 4 == 0) { //刚好满页 - page = _weekStarGiftList.count / 4; + if (_weekStarGiftList.count % 8 == 0) { //刚好满页 + page = _weekStarGiftList.count / 8; } else { - page = _weekStarGiftList.count / 4 + 1; + page = _weekStarGiftList.count / 8 + 1; } self.pageController.hidden = page <= 1; [self.pageController setNumberOfPages:page]; @@ -259,24 +118,12 @@ [self.collectionView reloadData]; } -- (void)setSelectGiftInfo:(GiftInfoModel *)selectGiftInfo { - _selectGiftInfo = selectGiftInfo; - if (_selectGiftInfo) { - self.sendUserView.firstCharmRankUser = _selectGiftInfo.firstCharmRankUser; - self.receiveUserView.firstLevelRankUser = _selectGiftInfo.firstLevelRankUser; - } else { - self.receiveUserView.hidden = YES; - self.sendUserView.hidden = YES; - } -} - - (UICollectionView *)collectionView{ if (!_collectionView) { XPGiftCollectionViewFlowLayout *layout = [[XPGiftCollectionViewFlowLayout alloc] init]; layout.minimumLineSpacing = 5; layout.minimumInteritemSpacing = 5; layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0); - layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; _collectionView.dataSource = self; _collectionView.delegate = self; @@ -288,31 +135,6 @@ return _collectionView; } -- (UIStackView *)userStackView { - if (!_userStackView) { - _userStackView = [[UIStackView alloc] init]; - _userStackView.axis = UILayoutConstraintAxisHorizontal; - _userStackView.distribution = UIStackViewDistributionFillEqually; - _userStackView.alignment = UIStackViewAlignmentFill; - _userStackView.spacing = 0; - } - return _userStackView; -} - -- (XPGiftWeekStarUserView *)sendUserView { - if (!_sendUserView) { - _sendUserView = [[XPGiftWeekStarUserView alloc] init]; - } - return _sendUserView; -} - -- (XPGiftWeekStarUserView *)receiveUserView { - if (!_receiveUserView) { - _receiveUserView = [[XPGiftWeekStarUserView alloc] init]; - } - return _receiveUserView; -} - - (UIPageControl *)pageController { if (!_pageController) { _pageController = [[UIPageControl alloc] init]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftBarView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftBarView.m index b860ed01..db34bdc3 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftBarView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftBarView.m @@ -318,7 +318,7 @@ if (_walletInfoModel) { NSString * diamonds = _walletInfoModel.diamonds; NSString * title = [NSString stringWithFormat:@"余额:%@", diamonds]; - NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13], NSForegroundColorAttributeName:[ThemeColor giftBalanceColor]}]; + NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[ThemeColor giftBalanceColor]}]; [attribute addAttribute:NSForegroundColorAttributeName value:[ThemeColor giftCountTitleColor] range:[title rangeOfString:diamonds]]; self.balanceLabel.attributedText = attribute; } @@ -348,7 +348,7 @@ if (!_rechargeLabel) { _rechargeLabel = [[UILabel alloc] init]; _rechargeLabel.text = @"充值"; - _rechargeLabel.font = [UIFont systemFontOfSize:13]; + _rechargeLabel.font = [UIFont systemFontOfSize:12]; _rechargeLabel.textColor = [ThemeColor giftRechargeColor]; } return _rechargeLabel; @@ -406,7 +406,7 @@ if (!_sendGiftButton) { _sendGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_sendGiftButton setTitle:@"赠送" forState:UIControlStateNormal]; - [_sendGiftButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal]; + [_sendGiftButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; [_sendGiftButton setTitle:@"赠送中..." forState:UIControlStateDisabled]; [_sendGiftButton setTitleColor:[ThemeColor disableButtonTextColor] forState:UIControlStateDisabled]; [_sendGiftButton setTitle:@"赠送" forState:UIControlStateSelected]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftHeadTypeView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftHeadTypeView.m index b651940d..2c1b0927 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftHeadTypeView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftHeadTypeView.m @@ -16,6 +16,8 @@ ///礼物 @property (nonatomic, strong) UIButton *giftButton; +///分割线 +@property (nonatomic, strong) UIView *devideView; ///互动 @property (nonatomic, strong) UIButton *interactButton; ///轮播图 @@ -39,6 +41,7 @@ #pragma mark - Private Method - (void)initSubViews { [self addSubview:self.giftButton]; + [self addSubview:self.devideView]; [self addSubview:self.interactButton]; [self addSubview:self.cycleScrollView]; } @@ -51,13 +54,20 @@ [self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(16); make.centerY.mas_equalTo(self); - make.width.mas_equalTo(50); + make.width.mas_equalTo(30); }]; [self.interactButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self); + make.left.mas_equalTo(self.devideView.mas_right).mas_offset(8); + make.width.mas_equalTo(30); + }]; + + [self.devideView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(self); make.left.mas_equalTo(self.giftButton.mas_right).mas_offset(8); - make.width.mas_equalTo(50); + make.width.mas_equalTo(1); + make.height.mas_equalTo(10); }]; [self.cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-16); @@ -92,6 +102,8 @@ } sender.selected = YES; self.interactButton.selected = NO; + sender.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; + self.interactButton.titleLabel.font = [UIFont systemFontOfSize:13]; } - (void)interactButtonAction:(UIButton *)sender { @@ -102,6 +114,8 @@ } sender.selected = YES; self.giftButton.selected = NO; + sender.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; + self.giftButton.titleLabel.font = [UIFont systemFontOfSize:13]; } #pragma mark - setter @@ -119,11 +133,11 @@ - (UIButton *)giftButton { if (!_giftButton) { UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; - button.titleLabel.font = [UIFont systemFontOfSize:13]; + button.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; [button addTarget:self action:@selector(giftButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [button setTitle:@"礼物" forState:UIControlStateNormal]; - [button setTitleColor:[ThemeColor textThirdColor] forState:UIControlStateNormal]; - [button setTitleColor:[ThemeColor appMainColor] forState:UIControlStateSelected]; + [button setTitle:@"送礼" forState:UIControlStateNormal]; + [button setTitleColor:[ThemeColor secondTextColor] forState:UIControlStateNormal]; + [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; button.selected = YES; _giftButton = button; } @@ -136,13 +150,21 @@ button.titleLabel.font = [UIFont systemFontOfSize:13]; [button addTarget:self action:@selector(interactButtonAction:) forControlEvents:UIControlEventTouchUpInside]; [button setTitle:@"互动" forState:UIControlStateNormal]; - [button setTitleColor:[ThemeColor textThirdColor] forState:UIControlStateNormal]; - [button setTitleColor:[ThemeColor appMainColor] forState:UIControlStateSelected]; + [button setTitleColor:[ThemeColor secondTextColor] forState:UIControlStateNormal]; + [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; _interactButton = button; } return _interactButton; } +- (UIView *)devideView { + if (!_devideView) { + _devideView = [[UIView alloc] init]; + _devideView.backgroundColor = UIColorRGBAlpha(0xffffff, 0.1); + } + return _devideView; +} + - (SDCycleScrollView *)cycleScrollView { if (!_cycleScrollView) { _cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:nil]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h index 9428d38e..c5a8510c 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h @@ -23,20 +23,14 @@ typedef NS_ENUM(NSInteger, GiftSegmentType) { @protocol XPGiftInfoViewDelegate -///点击了 规则说明 -- (void)xPGiftInfoView:(XPGiftInfoView *)view didClickPlayRule:(NSString *)ruleUrl; - ///点击了切换不同礼物的tabbar - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickSegment:(GiftSegmentType)type; ///点击了某个item - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type; -///点击了贵族特权 -- (void)xPGiftInfoViewDidClickNobleEntrance:(XPGiftInfoView *)view; - -///点击了周星榜 -- (void)xpGiftInfoViewDidClickWeekStarRank:(XPGiftInfoView *)view; +///点击了某个周星礼物 +- (void)xpGiftInfoViewDidClickWeekStarGift:(GiftInfoModel *)info; @end @@ -58,6 +52,10 @@ typedef NS_ENUM(NSInteger, GiftSegmentType) { @property (nonatomic, copy) NSString *defaultSelectGiftId; +///头部礼物类型变更 +/// - Parameter headType: 1:礼物 2:互动 +- (void)giftHeadTypeHadChange:(NSInteger)headType; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m index 654a59f5..fbec57a3 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m @@ -20,9 +20,8 @@ #import "XPGiftEmptyCollectionViewCell.h" #import "XPGiftWeekStarCollectionViewCell.h" #import "XPGiftCollectionViewFlowLayout.h" -#import "XPWeekStarInfoView.h" -@interface XPGiftInfoView () +@interface XPGiftInfoView () ///滚动的容器 @property (nonatomic,strong) UIScrollView *scrollView; @property (nonatomic,strong) UIStackView *segmentStackView; @@ -36,18 +35,10 @@ @property (nonatomic,strong) UIButton *nobleGiftButton; ///周星礼物 @property (nonatomic, strong) UIButton *weekStarButton; -///占位的 -@property (nonatomic,strong) UIView * segmentPlaceView; -///玩法规则的 -@property (nonatomic,strong) UIButton *playRuleButton; ///涂鸦礼物 @property (nonatomic,strong) UIButton *graffitiButton; ///背包总价值 @property (nonatomic,strong) UILabel *totalValueLabel; -///周星榜 -@property (nonatomic,strong) XPWeekStarInfoView *weekStarView; -///贵族特权 -@property (nonatomic, strong) UIButton *nobleButton; /// @property (nonatomic,strong) UIStackView *giftStackView; ///l礼物列表 @@ -102,23 +93,6 @@ self.segmentType = sender.tag; } -- (void)playRuleButtonAction:(UIButton *)sender { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickPlayRule:)]) { - NSString * giftExplainUrl; - if (self.segmentType == GiftSegmentType_Lucky) { - giftExplainUrl = [NSString stringWithFormat:URLWithType(kLuckyGiftPlayRuleURL), [NSString stringWithFormat:@"%ld", self.lastSelectGift.giftId]]; - } else { - giftExplainUrl = self.lastSelectGift.giftExplainUrl; - } - [self.delegate xPGiftInfoView:self didClickPlayRule:giftExplainUrl]; - } -} -- (void)didClickNobleSegmentAction:(UIButton *)sender { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoViewDidClickNobleEntrance:)]) { - [self.delegate xPGiftInfoViewDidClickNobleEntrance:self]; - } -} - #pragma mark - Public Method - (void)updatePackSource:(GiftReceiveInfoModel *)giftReceiveInfo numberUser:(NSInteger)numberUser { GiftInfoModel * giftInfo = [self findGiftInfoByGiftId:giftReceiveInfo.giftId.integerValue]; @@ -129,25 +103,41 @@ [self.giftcollectionView reloadData]; } +- (void)giftHeadTypeHadChange:(NSInteger)headType { + if (headType == 1) { + [self.graffitiButton removeFromSuperview]; + [self.segmentStackView addArrangedSubview:self.normalGiftButton]; + [self.segmentStackView addArrangedSubview:self.luckyGiftButton]; + [self.segmentStackView addArrangedSubview:self.nobleGiftButton]; + [self.segmentStackView addArrangedSubview:self.weekStarButton]; + if(self.segmentType != GiftSegmentType_Pack) { + [self didClickGiftSegmentAction:self.normalGiftButton]; + } + } else { + [self.normalGiftButton removeFromSuperview]; + [self.luckyGiftButton removeFromSuperview]; + [self.nobleGiftButton removeFromSuperview]; + [self.weekStarButton removeFromSuperview]; + [self.segmentStackView addArrangedSubview:self.graffitiButton]; + if(self.segmentType != GiftSegmentType_Pack) { + [self didClickGiftSegmentAction:self.graffitiButton]; + } + } +} + #pragma mark - Private Method - (void)initSubViews { [self addSubview:self.scrollView]; [self addSubview:self.giftStackView]; - + [self addSubview:self.packGiftButton]; + [self addSubview:self.totalValueLabel]; [self.scrollView addSubview:self.segmentStackView]; ///分段控制 [self.segmentStackView addArrangedSubview:self.normalGiftButton]; [self.segmentStackView addArrangedSubview:self.luckyGiftButton]; [self.segmentStackView addArrangedSubview:self.nobleGiftButton]; [self.segmentStackView addArrangedSubview:self.weekStarButton]; - [self.segmentStackView addArrangedSubview:self.graffitiButton]; - [self.segmentStackView addArrangedSubview:self.packGiftButton]; - [self.segmentStackView addArrangedSubview:self.segmentPlaceView]; - [self.segmentStackView addArrangedSubview:self.playRuleButton]; - [self.segmentStackView addArrangedSubview:self.totalValueLabel]; - [self.segmentStackView addArrangedSubview:self.weekStarView]; - [self.segmentStackView addArrangedSubview:self.nobleButton]; ///礼物 [self.giftStackView addArrangedSubview:self.giftcollectionView]; [self.giftStackView addArrangedSubview:self.pageController]; @@ -163,14 +153,20 @@ }]; [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self).inset(15); + make.left.mas_equalTo(self).mas_offset(15); + make.right.mas_equalTo(self.packGiftButton.mas_left); make.top.mas_equalTo(self); make.height.mas_equalTo(30); }]; - - [self.playRuleButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(75); - }]; + [self.packGiftButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-15); + make.centerY.height.mas_equalTo(self.scrollView); + make.width.mas_equalTo(30); + }]; + [self.totalValueLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(self.packGiftButton.mas_left); + make.centerY.mas_equalTo(self.packGiftButton); + }]; [self.giftStackView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.segmentStackView.mas_bottom).offset(10); @@ -198,8 +194,8 @@ giftTotal += gift.count * gift.goldPrice; } }]; - NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"总价值:" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11],NSForegroundColorAttributeName:[ThemeColor giftPlayRuleColor]}]; - [str appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@钻石",[self countFormatCoinStr:giftTotal]] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13],NSForegroundColorAttributeName:[ThemeColor mainTextColor]}]]; + NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"总价值:" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[ThemeColor secondTextColor]}]; + [str appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@钻石",[self countFormatCoinStr:giftTotal]] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[UIColor whiteColor]}]]; self.totalAttribute = str; } @@ -227,8 +223,12 @@ } else { giftInfo.sourceType = GiftSourceType_Normal; } - self.playRuleButton.hidden = self.segmentType == GiftSegmentType_Lucky ? NO : giftInfo.giftExplainUrl.length <= 0 ; giftInfo.isSelected = YES; + if (self.segmentType == GiftSegmentType_WeekStar) { + if (self.delegate && [self.delegate respondsToSelector:@selector(xpGiftInfoViewDidClickWeekStarGift:)]) { + [self.delegate xpGiftInfoViewDidClickWeekStarGift:giftInfo]; + } + } } // 根据礼物id查找 @@ -312,13 +312,6 @@ } } -#pragma mark - XPWeekStarInfoViewDelegate -- (void)xPWeekStarInfoViewRankButtonClick { - if (self.delegate && [self.delegate respondsToSelector:@selector(xpGiftInfoViewDidClickWeekStarRank:)]) { - [self.delegate xpGiftInfoViewDidClickWeekStarRank:self]; - } -} - #pragma mark - XPGiftWeekStarCollectionViewCellDelegate - (void)xPGiftWeekStarCollectionViewCell:(XPGiftWeekStarCollectionViewCell *)view didSelectGift:(GiftInfoModel *)giftInfo { [self dealSelectGift:giftInfo]; @@ -338,8 +331,6 @@ [self resetSelectGift:self.giftWeekStarArray]; [self resetSelectGift:self.giftGraffitiArray]; self.totalValueLabel.hidden = YES; - self.nobleButton.hidden = YES; - self.weekStarView.hidden = YES; switch (_segmentType) { case GiftSegmentType_Normal: [self.datasource addObjectsFromArray:self.giftArray]; @@ -349,12 +340,10 @@ break; case GiftSegmentType_Noble: { [self.datasource addObjectsFromArray:self.giftNobleArray]; - self.nobleButton.hidden = NO; } break; case GiftSegmentType_WeekStar: { [self.datasource addObjectsFromArray:self.giftWeekStarArray]; - self.weekStarView.hidden = NO; } break; case GiftSegmentType_Pack: @@ -383,8 +372,6 @@ GiftInfoModel * gift = [self.datasource firstObject]; [self dealSelectGift:gift]; } - } else { - self.playRuleButton.hidden = YES; } NSInteger page = 0; if (self.datasource.count % 8 == 0) { //刚好满页 @@ -519,7 +506,7 @@ [_normalGiftButton setTitle:@"礼物" forState:UIControlStateNormal]; [_normalGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_normalGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; - _normalGiftButton.titleLabel.font = [UIFont systemFontOfSize:14]; + _normalGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; _normalGiftButton.tag = GiftSegmentType_Normal; _normalGiftButton.selected = YES; [_normalGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside]; @@ -533,7 +520,7 @@ [_luckyGiftButton setTitle:@"幸运礼物" forState:UIControlStateNormal]; [_luckyGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_luckyGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; - _luckyGiftButton.titleLabel.font = [UIFont systemFontOfSize:14]; + _luckyGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; _luckyGiftButton.tag = GiftSegmentType_Lucky; _luckyGiftButton.selected = NO; [_luckyGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside]; @@ -547,7 +534,7 @@ [_nobleGiftButton setTitle:@"贵族" forState:UIControlStateNormal]; [_nobleGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_nobleGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; - _nobleGiftButton.titleLabel.font = [UIFont systemFontOfSize:14]; + _nobleGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; _nobleGiftButton.tag = GiftSegmentType_Noble; _nobleGiftButton.selected = NO; [_nobleGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside]; @@ -561,7 +548,7 @@ [_weekStarButton setTitle:@"周星礼物" forState:UIControlStateNormal]; [_weekStarButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_weekStarButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; - _weekStarButton.titleLabel.font = [UIFont systemFontOfSize:14]; + _weekStarButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; _weekStarButton.tag = GiftSegmentType_WeekStar; _weekStarButton.selected = NO; [_weekStarButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside]; @@ -575,7 +562,7 @@ [_packGiftButton setTitle:@"背包" forState:UIControlStateNormal]; [_packGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_packGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; - _packGiftButton.titleLabel.font = [UIFont systemFontOfSize:14]; + _packGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; _packGiftButton.tag = GiftSegmentType_Pack; _packGiftButton.selected = NO; [_packGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside]; @@ -589,7 +576,7 @@ [_graffitiButton setTitle:@"涂鸦礼物" forState:UIControlStateNormal]; [_graffitiButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_graffitiButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; - _graffitiButton.titleLabel.font = [UIFont systemFontOfSize:14]; + _graffitiButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; _graffitiButton.tag = GiftSegmentType_Graffiti; _graffitiButton.selected = NO; [_graffitiButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside]; @@ -597,32 +584,6 @@ return _graffitiButton; } -- (UIButton *)nobleButton { - if (!_nobleButton) { - _nobleButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_nobleButton setBackgroundImage:[UIImage imageNamed:@"room_gift_noble_entrance"] forState:UIControlStateNormal]; - _nobleButton.tag = GiftSegmentType_Normal; - [_nobleButton addTarget:self action:@selector(didClickNobleSegmentAction:) forControlEvents:UIControlEventTouchUpInside]; - _nobleButton.hidden = YES; - } - return _nobleButton; -} - - -- (UIButton *)playRuleButton { - if (!_playRuleButton) { - _playRuleButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_playRuleButton setTitle:@"玩法说明" forState:UIControlStateNormal]; - [_playRuleButton setTitleColor:[ThemeColor giftPlayRuleColor] forState:UIControlStateNormal]; - _playRuleButton.titleLabel.font = [UIFont systemFontOfSize:13]; - [_playRuleButton setImage:[UIImage imageNamed:@"gift_info_rule"] forState:UIControlStateNormal]; - [_playRuleButton addTarget:self action:@selector(playRuleButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - [_playRuleButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)]; - _playRuleButton.hidden = YES; - } - return _playRuleButton; -} - - (UILabel *)totalValueLabel { if (!_totalValueLabel) { _totalValueLabel = [[UILabel alloc] init]; @@ -630,14 +591,6 @@ return _totalValueLabel; } -- (XPWeekStarInfoView *)weekStarView { - if (!_weekStarView) { - _weekStarView = [[XPWeekStarInfoView alloc] init]; - _weekStarView.delegate = self; - } - return _weekStarView; -} - - (UICollectionView *)giftcollectionView{ if (!_giftcollectionView) { XPGiftCollectionViewFlowLayout *layout = [[XPGiftCollectionViewFlowLayout alloc] init]; @@ -652,6 +605,7 @@ [_giftcollectionView registerClass:[XPGiftItemCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPGiftItemCollectionViewCell class])]; [_giftcollectionView registerClass:[XPGiftEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPGiftEmptyCollectionViewCell class])]; [_giftcollectionView registerClass:[XPGiftWeekStarCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPGiftWeekStarCollectionViewCell class])]; + _giftcollectionView.showsHorizontalScrollIndicator = NO; } return _giftcollectionView; } @@ -665,17 +619,6 @@ return _pageController; } -- (UIView *)segmentPlaceView { - if (!_segmentPlaceView) { - _segmentPlaceView = [[UIView alloc] init]; - _segmentPlaceView.backgroundColor = [UIColor redColor]; - [_segmentPlaceView setContentCompressionResistancePriority:UILayoutPriorityDefaultLow forAxis:UILayoutConstraintAxisHorizontal]; - [_segmentPlaceView setContentHuggingPriority:UILayoutPriorityDefaultLow forAxis:UILayoutConstraintAxisHorizontal]; - } - return _segmentPlaceView; -} - - - (NSMutableArray *)datasource { if (!_datasource) { _datasource = [NSMutableArray array]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftLuckyGiftBroadcastView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftLuckyGiftBroadcastView.h new file mode 100644 index 00000000..335a945d --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftLuckyGiftBroadcastView.h @@ -0,0 +1,25 @@ +// +// XPGiftLuckyGiftBoradCastView.h +// xplan-ios +// +// Created by GreenLand on 2022/10/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol XPGiftLuckyGiftBroadcastViewDelegate + +///点击了玩法说明 +- (void)xPGiftLuckyGiftBroadcastViewPlayDescClick; + +@end + +@interface XPGiftLuckyGiftBroadcastView : UIView + +@property (nonatomic, weak) id delegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftLuckyGiftBroadcastView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftLuckyGiftBroadcastView.m new file mode 100644 index 00000000..7aa0c54e --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftLuckyGiftBroadcastView.m @@ -0,0 +1,98 @@ +// +// XPGiftLuckyGiftBoradCastView.m +// xplan-ios +// +// Created by GreenLand on 2022/10/8. +// + +#import "XPGiftLuckyGiftBroadcastView.h" +///Third +#import +///Tool +#import "ThemeColor.h" + +@interface XPGiftLuckyGiftBroadcastView() + +///背景 +@property (nonatomic, strong) UIImageView *bgImageView; +///玩法说明 +@property (nonatomic, strong) UIImageView *playImageView; +///icon +@property (nonatomic, strong) UIImageView *iconImageView; + +@end + +@implementation XPGiftLuckyGiftBroadcastView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self addSubview:self.bgImageView]; + [self addSubview:self.iconImageView]; + [self addSubview:self.playImageView]; +} + +- (void)initSubViewConstraints { + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(0); + make.left.right.mas_equalTo(self).inset(10); + make.height.mas_equalTo(37); + }]; + + [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.bgImageView); + make.left.mas_equalTo(self.bgImageView).mas_offset(8); + make.width.height.mas_equalTo(20); + }]; + + [self.playImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.right.bottom.mas_equalTo(self.bgImageView); + make.width.mas_equalTo(67); + }]; +} + +#pragma mark - action +- (void)playButtonAction:(UITapGestureRecognizer *)tap { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftLuckyGiftBroadcastViewPlayDescClick)]) { + [self.delegate xPGiftLuckyGiftBroadcastViewPlayDescClick]; + } +} + +- (UIImageView *)bgImageView { + if (!_bgImageView) { + _bgImageView = [[UIImageView alloc] init]; + _bgImageView.image = [UIImage imageNamed:@"gift_lucky_broadcast_bg"]; + _bgImageView.contentMode = UIViewContentModeScaleToFill; + } + return _bgImageView; +} + +- (UIImageView *)iconImageView { + if (!_iconImageView) { + _iconImageView = [[UIImageView alloc] init]; + _iconImageView.image = [UIImage imageNamed:@"gift_lucky_broadcast_icon"]; + } + return _iconImageView; +} + +- (UIImageView *)playImageView { + if (!_playImageView) { + _playImageView = [[UIImageView alloc] init]; + _playImageView.image = [UIImage imageNamed:@"gift_lucky_broadcast_playType"]; + _playImageView.contentMode = UIViewContentModeScaleToFill; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(playButtonAction:)]; + _playImageView.userInteractionEnabled = YES; + [_playImageView addGestureRecognizer:tap]; + } + return _playImageView; +} + +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftUsersView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftUsersView.m index fa108d73..505389da 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftUsersView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftUsersView.m @@ -240,9 +240,9 @@ if (!_allMicroButton) { _allMicroButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_allMicroButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor cancelButtonGradientStartColor], [ThemeColor cancelButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - [_allMicroButton setTitleColor:[ThemeColor cancelButtonTextColor] forState:UIControlStateNormal]; + [_allMicroButton setTitleColor:[ThemeColor appMainColor] forState:UIControlStateNormal]; [_allMicroButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateSelected]; - [_allMicroButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateSelected]; + [_allMicroButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateSelected]; [_allMicroButton setTitle:@"全麦送" forState:UIControlStateSelected]; [_allMicroButton setTitle:@"全麦送" forState:UIControlStateNormal]; _allMicroButton.titleLabel.font = [UIFont systemFontOfSize:13]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftWeekStarBroadcastView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftWeekStarBroadcastView.h new file mode 100644 index 00000000..768f9d42 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftWeekStarBroadcastView.h @@ -0,0 +1,28 @@ +// +// XPGiftWeekStarBroadcastView.h +// xplan-ios +// +// Created by GreenLand on 2022/10/8. +// + +#import +#import "GiftInfoModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@protocol XPGiftWeekStarBroadcastViewDelegate + +///点击了周星榜入口 +- (void)xPGiftWeekStarBroadcastViewWeekStarClick; + +@end + +@interface XPGiftWeekStarBroadcastView : UIView + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, strong) GiftInfoModel *giftInfo; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftWeekStarBroadcastView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftWeekStarBroadcastView.m new file mode 100644 index 00000000..9c61822e --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftWeekStarBroadcastView.m @@ -0,0 +1,255 @@ +// +// XPGiftWeekStarBroadcastView.m +// xplan-ios +// +// Created by GreenLand on 2022/10/8. +// + +#import "XPGiftWeekStarBroadcastView.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "NetImageView.h" + +@interface XPGiftWeekStarBroadcastView() + +///背景 +@property (nonatomic, strong) UIImageView *bgImageView; +///周星榜入口 +@property (nonatomic, strong) UIButton *weekStarButton; +///魅力头像 +@property (nonatomic, strong) NetImageView *charmImageView; +///贡献头像 +@property (nonatomic, strong) NetImageView *contributeImageView; +///魅力标题 +@property (nonatomic, strong) UILabel *charmLabel; +///贡献标题 +@property (nonatomic, strong) UILabel *contributeLabel; +///魅力昵称背景 +@property (nonatomic, strong) UIView *charmBgView; +///魅力昵称 +@property (nonatomic, strong) UILabel *charmNickLabel; +///贡献昵称背景 +@property (nonatomic, strong) UIView *contributeBgView; +///贡献昵称 +@property (nonatomic, strong) UILabel *contributeNickLabel; + +@end + +@implementation XPGiftWeekStarBroadcastView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self addSubview:self.bgImageView]; + [self addSubview:self.weekStarButton]; + [self addSubview:self.charmImageView]; + [self addSubview:self.charmLabel]; + [self addSubview:self.charmBgView]; + [self addSubview:self.charmNickLabel]; + [self addSubview:self.contributeImageView]; + [self addSubview:self.contributeLabel]; + [self addSubview:self.contributeBgView]; + [self addSubview:self.contributeNickLabel]; +} + +- (void)initSubViewConstraints { + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(0); + make.left.right.mas_equalTo(self).inset(10); + make.height.mas_equalTo(44); + }]; + [self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.bgImageView).mas_offset(10); + make.width.height.mas_equalTo(30); + make.centerY.mas_equalTo(self.bgImageView); + }]; + [self.charmLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.charmImageView); + make.height.mas_equalTo(12); + make.left.mas_equalTo(self.charmImageView.mas_right).mas_offset(12); + }]; + [self.charmBgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.charmNickLabel); + make.height.mas_equalTo(16); + make.left.right.mas_equalTo(self.charmNickLabel).inset(-6); + }]; + [self.charmNickLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.charmLabel.mas_bottom).mas_offset(6); + make.height.mas_equalTo(12); + make.left.mas_equalTo(self.charmLabel); + }]; + + [self.contributeImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.charmLabel.mas_right).mas_offset(24); + make.width.height.mas_equalTo(30); + make.centerY.mas_equalTo(self.bgImageView); + }]; + [self.contributeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.contributeImageView); + make.height.mas_equalTo(12); + make.left.mas_equalTo(self.contributeImageView.mas_right).mas_offset(12); + }]; + [self.contributeBgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.contributeNickLabel); + make.height.mas_equalTo(16); + make.left.right.mas_equalTo(self.contributeNickLabel).inset(-6); + }]; + [self.contributeNickLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.contributeLabel.mas_bottom).mas_offset(6); + make.height.mas_equalTo(12); + make.left.mas_equalTo(self.contributeLabel); + }]; + [self.weekStarButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(30); + make.centerY.mas_equalTo(self.bgImageView); + make.right.mas_equalTo(self.bgImageView).mas_offset(-7); + make.width.mas_equalTo(38); + }]; +} + +#pragma mark - action +- (void)playButtonAction:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftWeekStarBroadcastViewWeekStarClick)]) { + [self.delegate xPGiftWeekStarBroadcastViewWeekStarClick]; + } +} + +- (void)setGiftInfo:(GiftInfoModel *)giftInfo { + if (giftInfo.firstCharmRankUser) { + self.charmImageView.imageUrl = giftInfo.firstCharmRankUser.avatar; + NSString * nick = giftInfo.firstCharmRankUser.nick; + if (nick.length > 8) { + nick = [nick substringFromIndex:8]; + } + self.charmNickLabel.text = nick; + } else { + self.charmImageView.image = [UIImageConstant defaultEmptyAvatarPlaceholder]; + self.charmNickLabel.text = @"虚位以待"; + } + + if (giftInfo.firstLevelRankUser) { + self.contributeImageView.imageUrl = giftInfo.firstLevelRankUser.avatar; + NSString * nick = giftInfo.firstLevelRankUser.nick; + if (nick.length > 8) { + nick = [nick substringFromIndex:8]; + } + self.contributeNickLabel.text = nick; + } else { + self.contributeImageView.image = [UIImageConstant defaultEmptyAvatarPlaceholder]; + self.contributeNickLabel.text = @"虚位以待"; + } +} + +- (UIImageView *)bgImageView { + if (!_bgImageView) { + _bgImageView = [[UIImageView alloc] init]; + _bgImageView.image = [UIImage imageNamed:@"gift_weekStar_background"]; + _bgImageView.contentMode = UIViewContentModeScaleAspectFill; + } + return _bgImageView; +} + +- (NetImageView *)charmImageView { + if (!_charmImageView) { + _charmImageView = [[NetImageView alloc] init]; + _charmImageView.userInteractionEnabled = YES; + _charmImageView.layer.masksToBounds = YES; + _charmImageView.layer.cornerRadius = 15; + } + return _charmImageView; +} + +- (UILabel *)charmLabel { + if (!_charmLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [ThemeColor mainTextColor]; + label.text = @"本周该礼物冠名者"; + _charmLabel = label; + } + return _charmLabel; +} + +- (UIView *)charmBgView { + if (!_charmBgView) { + UIView *view = [[UIView alloc] init]; + view.backgroundColor = UIColorRGBAlpha(0xffffff, 0.2); + view.layer.cornerRadius = 8; + view.layer.masksToBounds = YES; + _charmBgView = view; + } + return _charmBgView; +} + +- (UILabel *)charmNickLabel { + if (!_charmNickLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [UIColor whiteColor]; + _charmNickLabel = label; + } + return _charmNickLabel; +} + +- (NetImageView *)contributeImageView { + if (!_contributeImageView) { + _contributeImageView = [[NetImageView alloc] init]; + _contributeImageView.userInteractionEnabled = YES; + _contributeImageView.layer.masksToBounds = YES; + _contributeImageView.layer.cornerRadius = 15; + } + return _contributeImageView; +} + +- (UILabel *)contributeLabel { + if (!_contributeLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [ThemeColor mainTextColor]; + label.text = @"本周该礼物星神豪"; + _contributeLabel = label; + } + return _contributeLabel; +} + +- (UIView *)contributeBgView { + if (!_contributeBgView) { + UIView *view = [[UIView alloc] init]; + view.backgroundColor = UIColorRGBAlpha(0xffffff, 0.2); + view.layer.cornerRadius = 8; + view.layer.masksToBounds = YES; + _contributeBgView = view; + } + return _contributeBgView; +} +- (UILabel *)contributeNickLabel { + if (!_contributeNickLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [UIColor whiteColor]; + _contributeNickLabel = label; + } + return _contributeNickLabel; +} + +- (UIButton *)weekStarButton { + if (!_weekStarButton) { + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + [button setImage:[UIImage imageNamed:@"gift_weekStar_entrance"] forState:UIControlStateNormal]; + [button addTarget:self action:@selector(playButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + _weekStarButton = button; + } + return _weekStarButton; +} + +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGraffitiGiftView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGraffitiGiftView.h index c22d8d7f..db7667f0 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGraffitiGiftView.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGraffitiGiftView.h @@ -28,6 +28,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong) NSArray *animationArray; ///选择的用户个数 @property (nonatomic,assign) NSInteger selectUidNumber; + +- (void)clearData; +- (void)cratePriceAttribute; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m index 0b54ced0..d7081e40 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m @@ -33,6 +33,8 @@ #import "XPRoomHalfWebView.h" #import "XPGraffitiGiftView.h" #import "XPGiftHeadTypeView.h" +#import "XPGiftLuckyGiftBroadcastView.h" +#import "XPGiftWeekStarBroadcastView.h" ///P #import "XPGiftProtocol.h" ///VC @@ -41,13 +43,19 @@ #import "XPFirstRechargeViewController.h" #import "XPNobleCenterViewController.h" -@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate> +@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftWeekStarBroadcastViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate> ///顶部的区域 @property (nonatomic,strong) UIView * topView; ///内容区域 @property (nonatomic,strong) UIView *contentView; +///模糊背景 +@property (nonatomic, strong) UIVisualEffectView *effectView; /// @property (nonatomic,strong) UIStackView *stackView; +///幸运礼物广播 +@property (nonatomic, strong) XPGiftLuckyGiftBroadcastView *luckyBroadcastView; +///周星礼物广播 +@property (nonatomic, strong) XPGiftWeekStarBroadcastView *weekStarBroadcastView; ///礼物类型(普通/互动) @property (nonatomic, strong) XPGiftHeadTypeView *headTypeView; ///送礼物的人 @@ -100,7 +108,8 @@ #pragma mark - Private Method - (void)initSubViews { [self.view addSubview:self.topView]; - [self.view addSubview:self.contentView]; + [self.view addSubview:self.contentView]; + [self.contentView addSubview:self.effectView]; [self.contentView addSubview:self.stackView]; [self.stackView addArrangedSubview:self.graffitiView]; [self.stackView addArrangedSubview:self.headTypeView]; @@ -121,6 +130,9 @@ make.left.right.bottom.mas_equalTo(self.view); }]; + [self.effectView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.contentView); + }]; [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.bottom.mas_equalTo(self.contentView); }]; @@ -398,6 +410,30 @@ [self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil]; } +#pragma mark - XPGiftLuckyGiftBroadcastViewDelegate +///点击了玩法说明 +- (void)xPGiftLuckyGiftBroadcastViewPlayDescClick { + NSString * giftExplainUrl; + if (self.segmentType == GiftSegmentType_Lucky) { + giftExplainUrl = [NSString stringWithFormat:URLWithType(kLuckyGiftPlayRuleURL), [NSString stringWithFormat:@"%ld", self.giftInfoView.lastSelectGift.giftId]]; + } else { + giftExplainUrl = self.giftInfoView.lastSelectGift.giftExplainUrl; + } + XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init]; + webView.url = giftExplainUrl; + [TTPopup popupView:webView style:TTPopupStyleActionSheet]; +} + +#pragma mark - XPGiftWeekStarBroadcastViewDelegate +///点击了周星榜入口 +- (void)xPGiftWeekStarBroadcastViewWeekStarClick { + [self dismissViewControllerAnimated:YES completion:nil]; + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + webVC.roomUid = self.roomUid; + webVC.url = URLWithType(kNewWeekStarURL); + [self.delegate.getCurrentNav pushViewController:webVC animated:YES]; +} + #pragma mark - XPGiftHeadTypeViewDelegate ///点击了贵族 - (void)xPGiftHeadTypeViewDidClickNoble:(XPGiftHeadTypeView *)view { @@ -414,39 +450,59 @@ } ///点击了礼物 - (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view { - + [self.luckyBroadcastView removeFromSuperview]; + [self.giftInfoView giftHeadTypeHadChange:1]; + if (!self.graffitiView.hidden) {//清空涂鸦礼物 + [self.graffitiView clearData]; + [self.graffitiView cratePriceAttribute]; + [UIView animateWithDuration:0.2 animations:^{ + self.graffitiView.hidden = YES; + self.giftInfoView.hidden = NO; + }]; + } } ///点击了互动 - (void)xPGiftHeadTypeViewDidClickInteraction:(XPGiftHeadTypeView *)view { - + [self.luckyBroadcastView removeFromSuperview]; + [self.giftInfoView giftHeadTypeHadChange:2]; } #pragma mark - XPGiftInfoViewDelegate -- (void)xPGiftInfoView:(XPGiftInfoView *)view didClickPlayRule:(NSString *)ruleUrl { - XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init]; - webView.url = ruleUrl; - [TTPopup popupView:webView style:TTPopupStyleActionSheet]; -} - - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickSegment:(GiftSegmentType)type { self.segmentType = type; self.giftBarView.type = type; self.giftBarView.drawGiftCount = 0; + if (type == GiftSegmentType_Lucky) { + [self.weekStarBroadcastView removeFromSuperview]; + // self.presenter + if (!self.luckyBroadcastView.superview) { + [self.view addSubview:self.luckyBroadcastView]; + [self.luckyBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.left.right.mas_equalTo(0); + make.height.mas_equalTo(48); + }]; + } + } else if(type == GiftSegmentType_WeekStar) { + [self.luckyBroadcastView removeFromSuperview]; + if (!self.weekStarBroadcastView.superview) { + [self.view addSubview:self.weekStarBroadcastView]; + [self.weekStarBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.left.right.mas_equalTo(0); + make.height.mas_equalTo(56); + }]; + } + } else { + [self.luckyBroadcastView removeFromSuperview]; + [self.weekStarBroadcastView removeFromSuperview]; + } } -- (void)xPGiftInfoViewDidClickNobleEntrance:(XPGiftInfoView *)view { - [self dismissViewControllerAnimated:YES completion:nil]; - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceGiftClick]; - XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid]; - [self.delegate.getCurrentNav pushViewController:nobleVC animated:YES]; -} -- (void)xpGiftInfoViewDidClickWeekStarRank:(XPGiftInfoView *)view { - [self dismissViewControllerAnimated:YES completion:nil]; - XPWebViewController * webVC = [[XPWebViewController alloc] init]; - webVC.roomUid = self.roomUid; - webVC.url = URLWithType(kNewWeekStarURL); - [self.delegate.getCurrentNav pushViewController:webVC animated:YES]; +///点击了某个周星礼物 +- (void)xpGiftInfoViewDidClickWeekStarGift:(GiftInfoModel *)info { + self.weekStarBroadcastView.giftInfo = info; } - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type { @@ -605,11 +661,15 @@ return _topView; } - - (UIView *)contentView { if (!_contentView) { _contentView = [[UIView alloc] init]; - _contentView.backgroundColor = [ThemeColor giftBackGroundColor]; + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth, KScreenHeight) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(8, 8)]; + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; + maskLayer.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); + maskLayer.path = maskPath.CGPath; + _contentView.layer.mask = maskLayer; + } return _contentView; } @@ -675,4 +735,29 @@ return _headTypeView; } +- (XPGiftLuckyGiftBroadcastView *)luckyBroadcastView { + if (!_luckyBroadcastView) { + _luckyBroadcastView = [[XPGiftLuckyGiftBroadcastView alloc] init]; + _luckyBroadcastView.delegate = self; + } + return _luckyBroadcastView; +} + +- (XPGiftWeekStarBroadcastView *)weekStarBroadcastView { + if (!_weekStarBroadcastView) { + _weekStarBroadcastView = [[XPGiftWeekStarBroadcastView alloc] init]; + _weekStarBroadcastView.delegate = self; + } + return _weekStarBroadcastView; +} + +- (UIVisualEffectView *)effectView { + if (!_effectView) { + UIBlurEffect *beffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; + _effectView = [[UIVisualEffectView alloc] initWithEffect:beffect]; + _effectView.backgroundColor = UIColorRGBAlpha(0x000000, 0.1); + } + return _effectView; +} + @end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.h deleted file mode 100644 index aad3312e..00000000 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// XPWeekStarInfoView.h -// xplan-ios -// -// Created by GreenLand on 2022/5/7. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class XPWeekStarRankUserModel; - -@protocol XPWeekStarInfoViewDelegate - -///周星榜点击 -- (void)xPWeekStarInfoViewRankButtonClick; - -@end - -@interface XPWeekStarInfoView : UIView - -@property (nonatomic, weak) id delegate; - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.m deleted file mode 100644 index 7e560eff..00000000 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.m +++ /dev/null @@ -1,88 +0,0 @@ -// -// XPWeekStarInfoView.m -// xplan-ios -// -// Created by GreenLand on 2022/5/7. -// - -#import "XPWeekStarInfoView.h" -///Third -#import -///Tool -#import "XPMacro.h" -#import "ThemeColor+SendGift.h" -///Model -#import "XPWeekStarRankUserModel.h" - -@interface XPWeekStarInfoView() -///周星版入口 -@property (nonatomic, strong) UIButton *entranceButton; -///箭头 -@property (nonatomic, strong) UIImageView *arrowImageView; - -@end - -@implementation XPWeekStarInfoView - -- (instancetype)initWithFrame:(CGRect)frame{ - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.entranceButton]; - [self addSubview:self.arrowImageView]; -} - -- (void)initSubViewConstraints { - [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(55); - make.height.mas_equalTo(30); - }]; - - [self.entranceButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.mas_equalTo(self.arrowImageView.mas_left).mas_offset(-4); - make.width.mas_equalTo(48); - make.height.mas_equalTo(14); - make.centerY.mas_equalTo(self); - }]; - [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.mas_equalTo(0); - make.width.mas_equalTo(7); - make.height.mas_equalTo(10); - make.centerY.mas_equalTo(self); - }]; -} - -#pragma mark - events -- (void)didClickWeekStarRank:(UIButton *)sender { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPWeekStarInfoViewRankButtonClick)]) { - [self.delegate xPWeekStarInfoViewRankButtonClick]; - } -} - -#pragma mark - getter and setter -- (UIButton *)entranceButton { - if (!_entranceButton) { - _entranceButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _entranceButton.adjustsImageWhenHighlighted = NO; - [_entranceButton setBackgroundImage:[UIImage imageNamed:@"gift_bar_weekStar_button"] forState:UIControlStateNormal]; - [_entranceButton addTarget:self action:@selector(didClickWeekStarRank:) forControlEvents:UIControlEventTouchUpInside]; - } - return _entranceButton; -} - -- (UIImageView *)arrowImageView { - if (!_arrowImageView) { - _arrowImageView = [[UIImageView alloc] init]; - _arrowImageView.image = [UIImage imageNamed:@"gift_bar_weekStar_arrow"]; - } - return _arrowImageView; -} - -@end