diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 4a91f891..d9ef16ee 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -1122,6 +1122,8 @@ E8D48250278D68BA003C1D08 /* XPAcrpssRoomPKPanelView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8D4824F278D68BA003C1D08 /* XPAcrpssRoomPKPanelView.m */; }; E8D48253278D8228003C1D08 /* AcrossRoomPKPanelModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8D48252278D8228003C1D08 /* AcrossRoomPKPanelModel.m */; }; E8D48256278D83AE003C1D08 /* XPAcrossRoomPKPanelUserView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8D48255278D83AE003C1D08 /* XPAcrossRoomPKPanelUserView.m */; }; + E8D4DE442940462C00EC788D /* XPGiftTwelveStarBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8D4DE432940462C00EC788D /* XPGiftTwelveStarBroadcastView.m */; }; + E8D4DE472940473500EC788D /* GiftTwelveStarFirstModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8D4DE462940473500EC788D /* GiftTwelveStarFirstModel.m */; }; E8D55C9D28113218006935A5 /* MessageMenuModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8D55C9C28113218006935A5 /* MessageMenuModel.m */; }; E8D55CA0281186D6006935A5 /* SessionAudioRecordView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8D55C9F281186D6006935A5 /* SessionAudioRecordView.m */; }; E8D7D74B282BA1EC0007D7BD /* XPMonentsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8D7D74A282BA1EC0007D7BD /* XPMonentsTableViewCell.m */; }; @@ -3330,6 +3332,10 @@ E8D48252278D8228003C1D08 /* AcrossRoomPKPanelModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AcrossRoomPKPanelModel.m; sourceTree = ""; }; E8D48254278D83AE003C1D08 /* XPAcrossRoomPKPanelUserView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAcrossRoomPKPanelUserView.h; sourceTree = ""; }; E8D48255278D83AE003C1D08 /* XPAcrossRoomPKPanelUserView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAcrossRoomPKPanelUserView.m; sourceTree = ""; }; + E8D4DE422940462C00EC788D /* XPGiftTwelveStarBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftTwelveStarBroadcastView.h; sourceTree = ""; }; + E8D4DE432940462C00EC788D /* XPGiftTwelveStarBroadcastView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftTwelveStarBroadcastView.m; sourceTree = ""; }; + E8D4DE452940473500EC788D /* GiftTwelveStarFirstModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftTwelveStarFirstModel.h; sourceTree = ""; }; + E8D4DE462940473500EC788D /* GiftTwelveStarFirstModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftTwelveStarFirstModel.m; sourceTree = ""; }; E8D55C9B28113218006935A5 /* MessageMenuModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageMenuModel.h; sourceTree = ""; }; E8D55C9C28113218006935A5 /* MessageMenuModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageMenuModel.m; sourceTree = ""; }; E8D55C9E281186D6006935A5 /* SessionAudioRecordView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SessionAudioRecordView.h; sourceTree = ""; }; @@ -6860,6 +6866,8 @@ 9B41D36D282649230048C588 /* XPWeekStarRankUserModel.m */, E8A3538328FD67320014A784 /* GiftLuckyBroadcastModel.h */, E8A3538428FD67320014A784 /* GiftLuckyBroadcastModel.m */, + E8D4DE452940473500EC788D /* GiftTwelveStarFirstModel.h */, + E8D4DE462940473500EC788D /* GiftTwelveStarFirstModel.m */, ); path = Model; sourceTree = ""; @@ -6895,6 +6903,8 @@ 9B4D449228F15765002572D5 /* XPGiftLuckyGiftBroadcastView.m */, 9B4D449428F15EE7002572D5 /* XPGiftWeekStarBroadcastView.h */, 9B4D449528F15EE7002572D5 /* XPGiftWeekStarBroadcastView.m */, + E8D4DE422940462C00EC788D /* XPGiftTwelveStarBroadcastView.h */, + E8D4DE432940462C00EC788D /* XPGiftTwelveStarBroadcastView.m */, ); path = View; sourceTree = ""; @@ -10113,6 +10123,7 @@ E878894C273A607C00BF1D57 /* XPGiftUserCollectionViewCell.m in Sources */, 181D7F212727D9DB00B7C059 /* SocialStageView.m in Sources */, E8AB630D28ADD8C60023B0D2 /* XPMonentTopicContainerViewController.m in Sources */, + E8D4DE472940473500EC788D /* GiftTwelveStarFirstModel.m in Sources */, E8A1F7A2290689170099C952 /* XPNobleRankTableViewCell.m in Sources */, 187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */, 9BFE0D8E2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m in Sources */, @@ -10311,6 +10322,7 @@ E87E91522796A15500A7B3F2 /* MicroExtModel.m in Sources */, E8788948273A55D000BF1D57 /* XPGiftBarView.m in Sources */, E89DCF5728FFF076001647EC /* XPWishGiftEmptyTableViewCell.m in Sources */, + E8D4DE442940462C00EC788D /* XPGiftTwelveStarBroadcastView.m in Sources */, 9BA8A47227C5D590000365A3 /* XPVoiceCardCircleLayer.m in Sources */, E81A65422835120200F55894 /* XPMonentsInteractivePresenter.m in Sources */, 9B33E3D427D8A1A4003B0E62 /* XPSkillCardPlayerManager.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/Contents.json new file mode 100644 index 00000000..abce1bf7 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_constellationBanner_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_constellationBanner_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/gift_constellationBanner_bg@2x.png b/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/gift_constellationBanner_bg@2x.png new file mode 100644 index 00000000..07bf4002 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/gift_constellationBanner_bg@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/gift_constellationBanner_bg@3x.png b/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/gift_constellationBanner_bg@3x.png new file mode 100644 index 00000000..392f0d4b Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_constellationBanner_bg.imageset/gift_constellationBanner_bg@3x.png differ diff --git a/xplan-ios/Global/XPHtmlUrl.h b/xplan-ios/Global/XPHtmlUrl.h index d0f2f392..05b02d19 100644 --- a/xplan-ios/Global/XPHtmlUrl.h +++ b/xplan-ios/Global/XPHtmlUrl.h @@ -82,6 +82,8 @@ typedef NS_ENUM(NSUInteger, URLType) { kMonentsShareURL, ///红包规则 kRedPacketRuleURL, + ///星座入口 + kXinZuoStarURL, }; NSString * const URLWithType(URLType type); diff --git a/xplan-ios/Global/XPHtmlUrl.m b/xplan-ios/Global/XPHtmlUrl.m index b54576eb..126e03e1 100644 --- a/xplan-ios/Global/XPHtmlUrl.m +++ b/xplan-ios/Global/XPHtmlUrl.m @@ -52,7 +52,8 @@ NSString * const URLWithType(URLType type) { @(kSailingRecordURL) : @"activity/act-sail/win_record.html", ///航海中奖记录 @(kNetworkRenovateURL) : @"activity/activemodel/index.html?code=ZBGG",///网络整治乱象 @(kMonentsShareURL) : @"modules/world/share-page/index.html",///分享动态 - @(kRedPacketRuleURL) : @"modules/rule/red-packet-rule.html",///红包规则 + @(kRedPacketRuleURL) : @"modules/rule/red-packet-rule.html",///红包规则\ + @(kXinZuoStarURL) : @"activity/act-constellation/index.html",///星座礼物 }; NSString * url = [dic objectForKey:@(type)]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.h b/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.h index a1ad88e1..227941f1 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.h @@ -72,6 +72,9 @@ NS_ASSUME_NONNULL_BEGIN /// 请求福袋全服礼物全服记录 /// @param complection 完成 + (void)requestLuckGiftServerBagRecord:(HttpRequestHelperCompletion)complection; + +/// 请求星座礼物信息 ++ (void)requestTwelveStarFirst:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.m b/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.m index dabc0712..631d0e8b 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Api/Api+Gift.m @@ -6,7 +6,7 @@ // #import "Api+Gift.h" - +#import "NSMutableDictionary+Saft.h" @implementation Api (Gift) @@ -81,4 +81,11 @@ [self makeRequest:@"anchorFansTeam/sendJoinTeamGift" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, targetUids, giftNum, sendType, giftId, giftSource, giftType, roomUid, msg, uid, nil]; } +/// 请求星座礼物信息 ++ (void)requestTwelveStarFirst:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid { + NSMutableDictionary * params = [NSMutableDictionary dictionary]; + [params safeSetObject:roomUid forKey:@"roomUid"]; + [HttpRequestHelper request:@"twelveStar/getLastRankFirst" method:HttpRequestHelperMethodGET params:params completion:completion]; +} + @end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftTwelveStarFirstModel.h b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftTwelveStarFirstModel.h new file mode 100644 index 00000000..a46d9759 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftTwelveStarFirstModel.h @@ -0,0 +1,23 @@ +// +// GiftTwelveStarFirstModel.h +// xplan-ios +// +// Created by 冯硕 on 2022/12/7. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface GiftTwelveStarFirstModel : NSObject +@property (nonatomic, copy) NSString *avatar; +@property (nonatomic, copy) NSString *erbanNo; +@property (nonatomic, copy) NSString *markUrl; +@property (nonatomic, copy) NSString *nick; +@property (nonatomic, copy) NSString *twelveStarName; +@property (nonatomic, copy) NSString *uid; +@property (nonatomic, assign) NSInteger gender; +@property (nonatomic, copy) NSString *twelveId; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftTwelveStarFirstModel.m b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftTwelveStarFirstModel.m new file mode 100644 index 00000000..dd02171a --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftTwelveStarFirstModel.m @@ -0,0 +1,12 @@ +// +// GiftTwelveStarFirstModel.m +// xplan-ios +// +// Created by 冯硕 on 2022/12/7. +// + +#import "GiftTwelveStarFirstModel.h" + +@implementation GiftTwelveStarFirstModel + +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.h b/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.h index 938f2394..622bb781 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.h @@ -43,6 +43,9 @@ NS_ASSUME_NONNULL_BEGIN ///全服福袋记录记录 - (void)luckyGiftBroadcastRecord; + +///星座礼物 +- (void)getTwelveStarLastRankFirst:(NSString *)roomUid; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m b/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m index eb51c6f8..3fb37cdf 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m @@ -16,6 +16,7 @@ #import "GiftReceiveInfoModel.h" #import "UserInfoModel.h" #import "GiftLuckyBroadcastModel.h" +#import "GiftTwelveStarFirstModel.h" ///P #import "XPGiftProtocol.h" @@ -146,4 +147,12 @@ }]]; } +///获取十二星座礼物banner +- (void)getTwelveStarLastRankFirst:(NSString *)roomUid { + [Api requestTwelveStarFirst:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + GiftTwelveStarFirstModel * model = [GiftTwelveStarFirstModel modelWithDictionary:data.data]; + [[self getView] getTwelveStarLastRankFirstSuccess:model]; + }] roomUid:roomUid]; +} + @end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Protocol/XPGiftProtocol.h b/xplan-ios/Main/ModuleKit/SendGiftView/Protocol/XPGiftProtocol.h index a0e3cddf..add5c931 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Protocol/XPGiftProtocol.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Protocol/XPGiftProtocol.h @@ -8,7 +8,7 @@ #import NS_ASSUME_NONNULL_BEGIN -@class WalletInfoModel, GiftInfoModel, GiftReceiveInfoModel, UserInfoModel; +@class WalletInfoModel, GiftInfoModel, GiftReceiveInfoModel, UserInfoModel, GiftTwelveStarFirstModel; @protocol XPGiftProtocol ///获取用户信息成功 - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo; @@ -30,6 +30,9 @@ NS_ASSUME_NONNULL_BEGIN ///获取全服福袋礼物记录 - (void)luckyGiftBroadcastRecordSuccess:(NSArray *)records; +///获取周星礼物成功 +- (void)getTwelveStarLastRankFirstSuccess:(GiftTwelveStarFirstModel *)model; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h index bc3f772b..c4256aef 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h @@ -33,9 +33,6 @@ typedef NS_ENUM(NSInteger, GiftSegmentType) { ///点击了某个item - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type; -///点击了某个周星礼物 -- (void)xpGiftInfoViewDidClickWeekStarGift:(GiftInfoModel *)info; - @end @interface XPGiftInfoView : UIView diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m index 5989199b..fcf18ce1 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m @@ -266,11 +266,6 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc giftInfo.sourceType = GiftSourceType_Normal; } giftInfo.isSelected = YES; - if (self.segmentType == GiftSegmentType_WeekStar) { - if (self.delegate && [self.delegate respondsToSelector:@selector(xpGiftInfoViewDidClickWeekStarGift:)]) { - [self.delegate xpGiftInfoViewDidClickWeekStarGift:giftInfo]; - } - } } // 根据礼物id查找 @@ -644,7 +639,7 @@ static NSString *kSendGiftViewHidePunishNewIcon = @"kSendGiftViewHidePunishNewIc - (UIButton *)weekStarButton { if (!_weekStarButton) { _weekStarButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_weekStarButton setTitle:@"周星" forState:UIControlStateNormal]; + [_weekStarButton setTitle:@"星座礼物" forState:UIControlStateNormal]; [_weekStarButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_weekStarButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; _weekStarButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftTwelveStarBroadcastView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftTwelveStarBroadcastView.h new file mode 100644 index 00000000..5dc84bd6 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftTwelveStarBroadcastView.h @@ -0,0 +1,27 @@ +// +// XPGiftTwelveStarBroadcastView.h +// xplan-ios +// +// Created by 冯硕 on 2022/12/7. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class GiftTwelveStarFirstModel, XPGiftTwelveStarBroadcastView; + +@protocol XPGiftTwelveStarBroadcastViewDelegate + +- (void)xPGiftTwelveStarBroadcastView:(XPGiftTwelveStarBroadcastView *)view didClickDetail:(UIButton *)sender; +@end + +@interface XPGiftTwelveStarBroadcastView : UIView + +@property (nonatomic, strong) GiftTwelveStarFirstModel *giftInfo; + +///代理 +@property (nonatomic,weak) id delegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftTwelveStarBroadcastView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftTwelveStarBroadcastView.m new file mode 100644 index 00000000..a1f96ebe --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftTwelveStarBroadcastView.m @@ -0,0 +1,248 @@ +// +// XPGiftTwelveStarBroadcastView.m +// xplan-ios +// +// Created by 冯硕 on 2022/12/7. +// + +#import "XPGiftTwelveStarBroadcastView.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "TTPopup.h" +#import "XCCurrentVCStackManager.h" +#import "XPWebViewController.h" +#import "XPHtmlUrl.h" +#import "NetImageView.h" +///Model +#import "GiftTwelveStarFirstModel.h" + +@interface XPGiftTwelveStarBroadcastView() + +@property (nonatomic, strong) UIView *mainView; +///背景 +@property (nonatomic, strong) UIImageView *bgImageView; +///活动入口 +@property (nonatomic, strong) UIButton *weekStarButton; +///魅力头像 +@property (nonatomic, strong) NetImageView *iconImageView; +///贡献头像 +@property (nonatomic, strong) NetImageView *avatarImageView; +///魅力标题 +@property (nonatomic, strong) UILabel *charmLabel; +///贡献标题 +@property (nonatomic, strong) UILabel *contributeLabel; + +@property (nonatomic, strong) UIImageView *sexImageView; + +@property (nonatomic, strong) UILabel *desLabel; + +@end + +@implementation XPGiftTwelveStarBroadcastView + +- (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.mainView]; + [self.mainView addSubview:self.weekStarButton]; + [self.mainView addSubview:self.iconImageView]; + [self.mainView addSubview:self.avatarImageView]; + [self.mainView addSubview:self.charmLabel]; + [self.mainView addSubview:self.sexImageView]; + [self.mainView addSubview:self.contributeLabel]; + [self.mainView addSubview:self.desLabel]; + + self.iconImageView.hidden = YES; + self.avatarImageView.hidden = YES; + self.charmLabel.hidden = YES; + self.contributeLabel.hidden = YES; + self.sexImageView.hidden = YES; +} + +- (void)initSubViewConstraints { + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.width.mas_equalTo(355); + make.top.bottom.mas_equalTo(self); + }]; + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self.bgImageView); + make.height.mas_equalTo(36); + make.bottom.mas_equalTo(0); + }]; + [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.mainView).mas_offset(33); + make.width.height.mas_equalTo(30); + make.centerY.mas_equalTo(self.mainView); + }]; + [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.iconImageView.mas_right).mas_offset(8); + make.width.height.mas_equalTo(24); + make.centerY.mas_equalTo(self.mainView); + }]; + [self.charmLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(14); + make.bottom.mas_equalTo(self.avatarImageView.mas_centerY); + make.left.mas_equalTo(self.avatarImageView.mas_right).mas_offset(8); + }]; + + [self.contributeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(14); + make.top.mas_equalTo(self.charmLabel.mas_bottom); + make.left.mas_equalTo(self.charmLabel); + }]; + [self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(10); + make.left.mas_equalTo(self.contributeLabel.mas_right).mas_offset(2); + make.centerY.mas_equalTo(self.contributeLabel); + }]; + [self.weekStarButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(18); + make.centerY.mas_equalTo(self.mainView); + make.right.mas_equalTo(self.mainView).mas_offset(-25); + make.width.mas_equalTo(64); + }]; + [self.desLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.mainView); + make.left.mas_equalTo(self.mainView).mas_offset(54); + }]; +} + +#pragma mark - action +- (void)playButtonAction:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftTwelveStarBroadcastView:didClickDetail:)]) { + [self.delegate xPGiftTwelveStarBroadcastView:self didClickDetail:sender]; + } +} + +- (void)setGiftInfo:(GiftTwelveStarFirstModel *)giftInfo { + if (giftInfo.nick) { + self.iconImageView.imageUrl = giftInfo.markUrl; + self.avatarImageView.imageUrl = giftInfo.avatar; + self.charmLabel.text = [NSString stringWithFormat:@"上期星座月%@星主", giftInfo.twelveStarName]; + self.contributeLabel.text = giftInfo.nick; + NSString *imageName = giftInfo.gender == 1 ? @"common_sex_male" : @"common_sex_female"; + self.sexImageView.image = [UIImage imageNamed:imageName]; + self.iconImageView.hidden = NO; + self.avatarImageView.hidden = NO; + self.charmLabel.hidden = NO; + self.contributeLabel.hidden = NO; + self.sexImageView.hidden = NO; + self.desLabel.hidden = YES; + } else { + self.iconImageView.hidden = YES; + self.avatarImageView.hidden = YES; + self.charmLabel.hidden = YES; + self.contributeLabel.hidden = YES; + self.sexImageView.hidden = YES; + self.desLabel.hidden = NO; + } +} + +- (UIView *)mainView { + if (!_mainView) { + _mainView = [[UIView alloc] init]; + } + return _mainView; +} + +- (UIImageView *)bgImageView { + if (!_bgImageView) { + _bgImageView = [[UIImageView alloc] init]; + _bgImageView.image = [UIImage imageNamed:@"gift_constellationBanner_bg"]; + _bgImageView.contentMode = UIViewContentModeScaleAspectFill; + _bgImageView.userInteractionEnabled = YES; + } + return _bgImageView; +} + +- (NetImageView *)iconImageView { + if (!_iconImageView) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _iconImageView = [[NetImageView alloc] initWithConfig:config]; + _iconImageView.userInteractionEnabled = YES; + } + return _iconImageView; +} + +- (UILabel *)charmLabel { + if (!_charmLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium]; + label.textColor = UIColorFromRGB(0xFDE19B); + label.text = @"上期星座月天蝎座星主"; + _charmLabel = label; + } + return _charmLabel; +} + +- (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 = 12; + _avatarImageView.userInteractionEnabled = YES; + } + return _avatarImageView; +} + +- (UILabel *)contributeLabel { + if (!_contributeLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [UIColor whiteColor]; + label.text = @"昵称"; + _contributeLabel = label; + } + return _contributeLabel; +} + +- (UIButton *)weekStarButton { + if (!_weekStarButton) { + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + button.backgroundColor = UIColorRGBAlpha(0x000000, 0.36); + [button addTarget:self action:@selector(playButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [button setTitle:@"活动详情 >" forState:UIControlStateNormal]; + [button setTitleColor:UIColorFromRGB(0x00EEFF) forState:UIControlStateNormal]; + button.titleLabel.font = [UIFont systemFontOfSize:10]; + button.layer.masksToBounds = YES; + button.layer.cornerRadius = 9; + _weekStarButton = button; + } + return _weekStarButton; +} + +- (UIImageView *)sexImageView { + if (!_sexImageView) { + _sexImageView = [[UIImageView alloc] init]; + } + return _sexImageView; +} + +- (UILabel *)desLabel { + if (!_desLabel) { + _desLabel = [[UILabel alloc] init]; + _desLabel.text = @"星座物语,限定开启星座月!"; + _desLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; + _desLabel.textColor = UIColorFromRGB(0xFDE19B); + } + return _desLabel; +} + +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m index c50f9826..93431474 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m @@ -19,6 +19,7 @@ #import "XPHtmlUrl.h" #import "AccountInfoStorage.h" #import "NSArray+Safe.h" +#import "XCCurrentVCStackManager.h" ///Model #import "GiftInfoModel.h" #import "XPGiftCountModel.h" @@ -35,7 +36,7 @@ #import "XPGraffitiGiftView.h" #import "XPGiftHeadTypeView.h" #import "XPGiftLuckyGiftBroadcastView.h" -#import "XPGiftWeekStarBroadcastView.h" +#import "XPGiftTwelveStarBroadcastView.h" ///P #import "XPGiftProtocol.h" ///VC @@ -44,7 +45,7 @@ #import "XPFirstRechargeViewController.h" #import "XPNobleCenterViewController.h" -@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftWeekStarBroadcastViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate> +@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGiftInfoViewDelegate, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate> ///顶部的区域 @property (nonatomic,strong) UIView * topView; ///内容区域 @@ -55,8 +56,8 @@ @property (nonatomic,strong) UIStackView *stackView; ///幸运礼物广播 @property (nonatomic, strong) XPGiftLuckyGiftBroadcastView *luckyBroadcastView; -///周星礼物广播 -@property (nonatomic, strong) XPGiftWeekStarBroadcastView *weekStarBroadcastView; +///星座礼物广播 +@property (nonatomic, strong) XPGiftTwelveStarBroadcastView *constellationBanner; ///礼物类型(普通/互动) @property (nonatomic, strong) XPGiftHeadTypeView *headTypeView; ///送礼物的人 @@ -151,6 +152,7 @@ [self.presenter getNormalGiftList:self.roomUid]; [self.presenter getPackGiftList]; [self.presenter luckyGiftBroadcastRecord]; + [self.presenter getTwelveStarLastRankFirst:self.roomUid]; } #pragma mark - Send Custom Message @@ -404,15 +406,17 @@ ///充值 - (void)xPGiftBarViewDidClickRecharge:(XPGiftBarView *)view { - [self dismissViewControllerAnimated:YES completion:nil]; - XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init]; - [self.delegate.getCurrentNav pushViewController:rechargeVC animated:YES]; + [self dismissViewControllerAnimated:NO completion:^{ + XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES]; + }]; } - (void)xPGiftBarViewDidClickFirstRecharge:(XPGiftBarView *)view { - [self dismissViewControllerAnimated:YES completion:nil]; - XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:self.delegate.getCurrentNav]; - [self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil]; + [self dismissViewControllerAnimated:NO completion:^{ + XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:self.delegate.getCurrentNav]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; + }]; } #pragma mark - XPGiftLuckyGiftBroadcastViewDelegate @@ -432,26 +436,30 @@ #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]; + [self dismissViewControllerAnimated:NO completion:^{ + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + webVC.roomUid = self.roomUid; + webVC.url = URLWithType(kNewWeekStarURL); + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; + }]; } #pragma mark - XPGiftHeadTypeViewDelegate ///点击了贵族 - (void)xPGiftHeadTypeViewDidClickNoble:(XPGiftHeadTypeView *)view { - [self dismissViewControllerAnimated:YES completion:nil]; - [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceGiftClick]; - XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid]; - [self.delegate.getCurrentNav pushViewController:nobleVC animated:YES]; + [self dismissViewControllerAnimated:NO completion:^{ + [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceGiftClick]; + XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:nobleVC animated:YES]; + }]; } ///点击了首充 - (void)xPGiftHeadTypeViewDidClickFirstRecharge:(XPGiftHeadTypeView *)view { - [self dismissViewControllerAnimated:YES completion:nil]; - XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:self.delegate.getCurrentNav]; - [self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil]; + [self dismissViewControllerAnimated:NO completion:^{ + XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; + }]; + } ///点击了礼物 - (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view { @@ -478,7 +486,7 @@ self.giftBarView.type = type; self.giftBarView.drawGiftCount = 0; if (type == GiftSegmentType_Lucky) { - [self.weekStarBroadcastView removeFromSuperview]; + [self.constellationBanner removeFromSuperview]; // self.presenter if (!self.luckyBroadcastView.superview) { [self.view addSubview:self.luckyBroadcastView]; @@ -490,26 +498,20 @@ } } else if(type == GiftSegmentType_WeekStar) { [self.luckyBroadcastView removeFromSuperview]; - if (!self.weekStarBroadcastView.superview) { - [self.view addSubview:self.weekStarBroadcastView]; - [self.weekStarBroadcastView mas_makeConstraints:^(MASConstraintMaker *make) { + if (!self.constellationBanner.superview) { + [self.view addSubview:self.constellationBanner]; + [self.constellationBanner mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.mas_equalTo(self.contentView.mas_top); make.left.right.mas_equalTo(0); - make.height.mas_equalTo(56); + make.height.mas_equalTo(75); }]; } } else { [self.luckyBroadcastView removeFromSuperview]; - [self.weekStarBroadcastView removeFromSuperview]; + [self.constellationBanner removeFromSuperview]; } } - -///点击了某个周星礼物 -- (void)xpGiftInfoViewDidClickWeekStarGift:(GiftInfoModel *)info { - self.weekStarBroadcastView.giftInfo = info; -} - - (void)xPGiftInfoView:(XPGiftInfoView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type { if (type == GiftSegmentType_Graffiti) { self.giftInfoView.hidden = YES; @@ -554,6 +556,15 @@ self.giftBarView.drawGiftCount = self.graffitiPoint.count; } +#pragma mark - XPGiftTwelveStarBroadcastViewDelegate +- (void)xPGiftTwelveStarBroadcastView:(XPGiftTwelveStarBroadcastView *)view didClickDetail:(UIButton *)sender { + [self dismissViewControllerAnimated:NO completion:^{ + XPWebViewController * webVC = [[XPWebViewController alloc] init]; + webVC.url = URLWithType(kXinZuoStarURL); + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; + }]; +} + #pragma mark - XPGiftProtocol - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo { self.headTypeView.isShowFirstRecharge = userInfo.isFirstCharge; @@ -633,9 +644,10 @@ /// 余额不足,是否弹首充弹窗 - (void)showNotSufficientFundsWithToast:(NSString *)msg { if (self.delegate.getUserInfo.isFirstCharge) { - [self dismissViewControllerAnimated:YES completion:nil]; - XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:self.delegate.getCurrentNav]; - [self.delegate.getCurrentNav presentViewController:firstRechargeVC animated:YES completion:nil]; + [self dismissViewControllerAnimated:NO completion:^{ + XPFirstRechargeViewController * firstRechargeVC = [[XPFirstRechargeViewController alloc] initWithNavigation:XCCurrentVCStackManager.shareManager.getCurrentVC.navigationController]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:firstRechargeVC animated:YES completion:nil]; + }]; } else { [self showErrorToast:msg]; } @@ -647,6 +659,10 @@ self.luckyBroadcastView.records = records; } +- (void)getTwelveStarLastRankFirstSuccess:(GiftTwelveStarFirstModel *)model { + self.constellationBanner.giftInfo = model; +} + #pragma mark - Event Response - (void)disMissViewRecognizer:(UITapGestureRecognizer *)tap { [self dismissViewControllerAnimated:YES completion:nil]; @@ -762,12 +778,12 @@ return _luckyBroadcastView; } -- (XPGiftWeekStarBroadcastView *)weekStarBroadcastView { - if (!_weekStarBroadcastView) { - _weekStarBroadcastView = [[XPGiftWeekStarBroadcastView alloc] init]; - _weekStarBroadcastView.delegate = self; +- (XPGiftTwelveStarBroadcastView *)constellationBanner { + if (!_constellationBanner) { + _constellationBanner = [[XPGiftTwelveStarBroadcastView alloc] init]; + _constellationBanner.delegate = self; } - return _weekStarBroadcastView; + return _constellationBanner; } - (UIVisualEffectView *)effectView {