diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 3622168c..9ba372fd 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -151,6 +151,8 @@ 9B33E3CE27D8540C003B0E62 /* XPVoiceCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B33E3CD27D8540C003B0E62 /* XPVoiceCardViewController.m */; }; 9B33E3D427D8A1A4003B0E62 /* XPSkillCardPlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B33E3D327D8A1A4003B0E62 /* XPSkillCardPlayerManager.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 */; }; 9B4D148127E485EB000AA0C1 /* XPRoomTrumpetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B4D148027E485EB000AA0C1 /* XPRoomTrumpetView.m */; }; 9B5BF8A827E1BED1005DD346 /* Api+RoomTrumpet.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B5BF8A727E1BED1005DD346 /* Api+RoomTrumpet.m */; }; 9B5F1503280FF02600C3C2B1 /* anchorPk_crossPking.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9B5F1502280FF02600C3C2B1 /* anchorPk_crossPking.svga */; }; @@ -1016,6 +1018,10 @@ 9B33E3D327D8A1A4003B0E62 /* XPSkillCardPlayerManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSkillCardPlayerManager.m; sourceTree = ""; }; 9B3A1DF2280571000058E2DD /* XPAnchorPKInviteView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorPKInviteView.h; sourceTree = ""; }; 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 = ""; }; 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 = ""; }; 9B5BF8A627E1BED1005DD346 /* Api+RoomTrumpet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+RoomTrumpet.h"; sourceTree = ""; }; @@ -4511,6 +4517,8 @@ E8DACCFD27673F870052092C /* GiftValueInfoModel.m */, 9B208A342779B50100F9E54A /* GiftNobleInfoModel.h */, 9B208A352779B50100F9E54A /* GiftNobleInfoModel.m */, + 9B41D36C282649230048C588 /* XPWeekStarRankUserModel.h */, + 9B41D36D282649230048C588 /* XPWeekStarRankUserModel.m */, ); path = Model; sourceTree = ""; @@ -4538,6 +4546,8 @@ E8788947273A55D000BF1D57 /* XPGiftBarView.m */, E890BC0B273D09A50007C46B /* XPGiftCountView.h */, E890BC0C273D09A50007C46B /* XPGiftCountView.m */, + 9B41D36F28264E320048C588 /* XPWeekStarInfoView.h */, + 9B41D37028264E320048C588 /* XPWeekStarInfoView.m */, ); path = View; sourceTree = ""; @@ -6646,6 +6656,7 @@ E824546426F5FF1C00BE8163 /* XPMineResetPayPasswordPresenter.m in Sources */, E877A7EE278428FB00EFACED /* MicroDatingProgressView.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 */, @@ -6673,6 +6684,7 @@ E8C1CD7627D8AE3D00376F83 /* XPRoomFacePresenter.m in Sources */, 18F4043A275E20D900A6C548 /* TRTCRtcImpl.m in Sources */, E8899C7F27853B6A007944BE /* DatingMicroView.m in Sources */, + 9B41D36E282649230048C588 /* XPWeekStarRankUserModel.m in Sources */, E8E5E19A27C36C0B00F457D8 /* XPHomeHotRoomTableViewCell.m in Sources */, E824545926F5E65900BE8163 /* XPMineVerifIdentityView.m in Sources */, 9BCE6147277D665600CC0358 /* XPReleaseRadioCellModel.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/Contents.json new file mode 100644 index 00000000..02803230 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_bar_weekStar_arrow@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_bar_weekStar_arrow@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/gift_bar_weekStar_arrow@2x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/gift_bar_weekStar_arrow@2x.png new file mode 100644 index 00000000..e565cc5d Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/gift_bar_weekStar_arrow@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/gift_bar_weekStar_arrow@3x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/gift_bar_weekStar_arrow@3x.png new file mode 100644 index 00000000..ff9344a0 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_arrow.imageset/gift_bar_weekStar_arrow@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/Contents.json b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/Contents.json new file mode 100644 index 00000000..8c19f469 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gift_bar_weekStar_button@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gift_bar_weekStar_button@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/gift_bar_weekStar_button@2x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/gift_bar_weekStar_button@2x.png new file mode 100644 index 00000000..771120c3 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/gift_bar_weekStar_button@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/gift_bar_weekStar_button@3x.png b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/gift_bar_weekStar_button@3x.png new file mode 100644 index 00000000..7b83356b Binary files /dev/null and b/xplan-ios/Assets.xcassets/Gift/gift_bar_weekStar_button.imageset/gift_bar_weekStar_button@3x.png differ diff --git a/xplan-ios/Global/XPHtmlUrl.h b/xplan-ios/Global/XPHtmlUrl.h index 1606fd6f..18581ac0 100644 --- a/xplan-ios/Global/XPHtmlUrl.h +++ b/xplan-ios/Global/XPHtmlUrl.h @@ -64,6 +64,8 @@ typedef NS_ENUM(NSUInteger, URLType) { kAnchorFansRankURL, ///主播粉丝团-粉丝团规则 kAnchorFansRuleURL, + ///周星礼物-周星榜 + kNewWeekStarURL, }; NSString * const URLWithType(URLType type); diff --git a/xplan-ios/Global/XPHtmlUrl.m b/xplan-ios/Global/XPHtmlUrl.m index 97865599..e57debaa 100644 --- a/xplan-ios/Global/XPHtmlUrl.m +++ b/xplan-ios/Global/XPHtmlUrl.m @@ -43,7 +43,8 @@ NSString * const URLWithType(URLType type) { @(kAnchorFansOpenURL) : @"modules/fans_club/nameplate.html", ///主播粉丝团-铭牌申请 @(kAnchorFansListURL) : @"modules/fans_club/myfans.html", ///主播粉丝团-粉丝列表 @(kAnchorFansRankURL) : @"modules/fans_club/fans_rank.html", ///主播粉丝团-粉丝排行 - @(kAnchorFansRuleURL) : @"modules/fans_club/rule.html" ///主播粉丝团-粉丝团规则 + @(kAnchorFansRuleURL) : @"modules/fans_club/rule.html", ///主播粉丝团-粉丝团规则 + @(kNewWeekStarURL) : @"modules/weekStar/newWeekStar.html" ///周星礼物-周星榜 }; NSString * url = [dic objectForKey:@(type)]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.h b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.h index 8f079dda..3630ac71 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/GiftInfoModel.h @@ -7,6 +7,7 @@ #import #import "GiftNobleInfoModel.h" +#import "XPWeekStarRankUserModel.h" NS_ASSUME_NONNULL_BEGIN //礼物类型 @@ -15,6 +16,7 @@ typedef NS_ENUM(NSUInteger, GiftType) { GiftType_Lucky = 3, // 福袋礼物 GiftType_LuckyPool = 5, //福袋奖池礼物 GiftType_Noble = 7, // 贵族礼物 + GiftType_WeekStar = 8, //周星礼物 }; //礼物类型 @@ -102,6 +104,14 @@ typedef NS_ENUM(NSUInteger, RoomSendGiftType) { ///贵族礼物专属信息 @property (nonatomic, strong) GiftNobleInfoModel *giftVipInfo; +/*----------周星礼物--------*/ +///上周周星礼物ID +@property (nonatomic, assign) NSInteger lastGiftId; +///上周对应礼物的魅力榜第一 +@property (nonatomic, strong) XPWeekStarRankUserModel *firstCharmRankUser; +///上周对应礼物豪气榜第一 +@property (nonatomic, strong) XPWeekStarRankUserModel *firstLevelRankUser; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/XPWeekStarRankUserModel.h b/xplan-ios/Main/ModuleKit/SendGiftView/Model/XPWeekStarRankUserModel.h new file mode 100644 index 00000000..75aa03f1 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/XPWeekStarRankUserModel.h @@ -0,0 +1,29 @@ +// +// XPCharmRankUserModel.h +// xplan-ios +// +// Created by GreenLand on 2022/5/7. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPWeekStarRankUserModel : NSObject + +///头像 +@property (nonatomic, copy) NSString *avatar; +///榜单值 +@property (nonatomic, assign) NSInteger amount; +///uid +@property (nonatomic, assign) NSInteger uid; +///二般号 +@property (nonatomic, assign) NSInteger erbanNo; +///昵称 +@property (nonatomic, copy) NSString *nick; +///礼物id +@property (nonatomic, assign) NSInteger giftId; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Model/XPWeekStarRankUserModel.m b/xplan-ios/Main/ModuleKit/SendGiftView/Model/XPWeekStarRankUserModel.m new file mode 100644 index 00000000..80f601c9 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Model/XPWeekStarRankUserModel.m @@ -0,0 +1,12 @@ +// +// XPCharmRankUserModel.m +// xplan-ios +// +// Created by GreenLand on 2022/5/7. +// + +#import "XPWeekStarRankUserModel.h" + +@implementation XPWeekStarRankUserModel + +@end diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m b/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m index a04dd2e3..95d48a27 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/Presenter/XPGiftPresenter.m @@ -48,11 +48,13 @@ NSArray *vipGift = [GiftInfoModel modelsWithArray:data.data[@"vipGift"]]; // 贵族礼物 NSArray *luckyPoolGift = [GiftInfoModel modelsWithArray:data.data[@"luckyPoolGift"]];// 福袋奖池礼物 NSArray *normalGift = [GiftInfoModel modelsWithArray:data.data[@"normalGift"]]; // 普通面板礼物 + NSArray *weekStarGift = [GiftInfoModel modelsWithArray:data.data[@"weekStarGift"]]; // 周星礼物 NSMutableArray *info = [NSMutableArray array]; NSMutableArray *totalInfo = [NSMutableArray array]; [info addObjectsFromArray:luckyBagGift]; [info addObjectsFromArray:vipGift]; [info addObjectsFromArray:normalGift]; + [info addObjectsFromArray:weekStarGift]; [totalInfo addObjectsFromArray:info]; [totalInfo addObjectsFromArray:luckyPoolGift]; ///把礼物信息保存一下 diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.h b/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.h index 9ac789dc..c6e50d8d 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.h @@ -20,9 +20,9 @@ NS_ASSUME_NONNULL_BEGIN + (UIColor *)giftBalanceColor; /// 送礼物 分页指示器的颜色 + (UIColor *)giftPageIndicatorColor; -/// 分段控制器文字默认的颜色 #0C0B0C +/// 分段控制器文字默认的颜色 #999999 + (UIColor *)giftSegmentNormalTitleColor; -/// 分段控制器文字选中的颜色 #FFFFFF +/// 分段控制器文字选中的颜色 #FFBC51 + (UIColor *)giftSegmentSelectTitleColor; /// 礼物选中的时候的颜色 0xFF903E + (UIColor *)giftNameSelectColor; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.m b/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.m index 32db6ef6..95ed9da5 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/ThemeColor+SendGift.m @@ -32,13 +32,13 @@ + (UIColor *)giftPageIndicatorColor { return [UIColor whiteColor]; } -/// 分段控制器文字默认的颜色 #0C0B0C +/// 分段控制器文字默认的颜色 #999999 + (UIColor *)giftSegmentNormalTitleColor { - return UIColorRGBAlpha(0xFFFFFF, 0.3); + return UIColorRGBAlpha(0x999999, 1); } -/// 分段控制器文字选中的颜色 #FFFFFF +/// 分段控制器文字选中的颜色 #FFBC51 + (UIColor *)giftSegmentSelectTitleColor { - return UIColorRGBAlpha(0xFFFFFF, 1); + return UIColorRGBAlpha(0xFFBC51, 1); } /// 礼物选中的时候的颜色 0xFF903E + (UIColor *)giftNameSelectColor { diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h index 6b29ddac..c8559a6b 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.h @@ -13,6 +13,7 @@ typedef NS_ENUM(NSInteger, GiftSegmentType) { GiftSegmentType_Normal = 1, ///普通的礼物 GiftSegmentType_Lucky,///幸运礼物 GiftSegmentType_Noble,///贵族礼物 + GiftSegmentType_WeekStar, ///周星礼物 GiftSegmentType_Pack,///背包礼物 }; @@ -30,6 +31,9 @@ typedef NS_ENUM(NSInteger, GiftSegmentType) { ///点击了贵族特权 - (void)xPGiftInfoViewDidClickNobleEntrance:(XPGiftInfoView *)view; +///点击了周星榜 +- (void)xpGiftInfoViewDidClickWeekStarRank:(XPGiftInfoView *)view; + @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 21529f89..566fa769 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPGiftInfoView.m @@ -18,7 +18,9 @@ #import "XPGiftItemCollectionViewCell.h" #import "XPGiftEmptyCollectionViewCell.h" #import "XPGiftCollectionViewFlowLayout.h" -@interface XPGiftInfoView () +#import "XPWeekStarInfoView.h" + +@interface XPGiftInfoView () /// @property (nonatomic,strong) UIStackView *segmentStackView; ///普通礼物 @@ -29,6 +31,8 @@ @property (nonatomic,strong) UIButton *luckyGiftButton; ///贵族礼物 @property (nonatomic,strong) UIButton *nobleGiftButton; +///周星礼物 +@property (nonatomic, strong) UIButton *weekStarButton; ///占位的 @property (nonatomic,strong) UIView * segmentPlaceView; ///玩法规则的 @@ -39,6 +43,8 @@ @property (nonatomic, strong) UIButton *nobleButton; /// @property (nonatomic,strong) UIStackView *giftStackView; +///周星榜用户信息 +@property (nonatomic, strong) XPWeekStarInfoView *weekStarView; ///l礼物列表 @property (nonatomic,strong) UICollectionView *giftcollectionView; ///分页控件 @@ -51,6 +57,8 @@ @property (nonatomic,strong) NSArray *giftLuckyArray; ///贵族礼物的数据源 @property (nonatomic, strong) NSArray *giftNobleArray; +///周星礼物的数据源 +@property (nonatomic, strong) NSArray *giftWeekStarArray; /////背包礼物的数据源 @property (nonatomic,strong) NSArray *giftPackArray; ///总的价值 @@ -79,6 +87,7 @@ self.luckyGiftButton.selected = NO; self.nobleGiftButton.selected = NO; self.packGiftButton.selected = NO; + self.weekStarButton.selected = NO; sender.selected = !sender.selected; self.segmentType = sender.tag; } @@ -113,11 +122,14 @@ [self.segmentStackView addArrangedSubview:self.normalGiftButton]; [self.segmentStackView addArrangedSubview:self.luckyGiftButton]; [self.segmentStackView addArrangedSubview:self.nobleGiftButton]; + [self.segmentStackView addArrangedSubview:self.weekStarButton]; [self.segmentStackView addArrangedSubview:self.packGiftButton]; [self.segmentStackView addArrangedSubview:self.segmentPlaceView]; [self.segmentStackView addArrangedSubview:self.playRuleButton]; [self.segmentStackView addArrangedSubview:self.totalValueLabel]; [self.segmentStackView addArrangedSubview:self.nobleButton]; + ///周星榜信息 + [self addSubview:self.weekStarView]; ///礼物 [self.giftStackView addArrangedSubview:self.giftcollectionView]; [self.giftStackView addArrangedSubview:self.pageController]; @@ -125,18 +137,24 @@ - (void)initSubViewConstraints { [self mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(40 + 108 * 2 + 10 + 10); + make.height.mas_equalTo(30 + 108 * 2 + 10 + 10 + 25); }]; - - [self.segmentStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self).inset(15); - make.top.mas_equalTo(self); - make.height.mas_equalTo(40); - }]; + + [self.segmentStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self).inset(15); + make.top.mas_equalTo(self); + make.height.mas_equalTo(30); + }]; + + [self.weekStarView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self).inset(15); + make.top.mas_equalTo(self.segmentStackView.mas_bottom); + make.height.mas_equalTo(25); + }]; [self.giftStackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.segmentStackView.mas_bottom); + make.top.mas_equalTo(self.weekStarView.mas_bottom); make.left.right.mas_equalTo(self); make.height.mas_equalTo(108 * 2 + 20); }]; @@ -191,6 +209,10 @@ } self.playRuleButton.hidden = giftInfo.giftExplainUrl.length <= 0; giftInfo.isSelected = YES; + if (self.segmentType == GiftSegmentType_WeekStar) { + self.weekStarView.firstCharmRankUser = giftInfo.firstCharmRankUser; + self.weekStarView.firstLevelRankUser = giftInfo.firstLevelRankUser; + } } // 根据礼物id查找 @@ -252,6 +274,13 @@ } } +#pragma mark - XPWeekStarInfoViewDelegate +- (void)xPWeekStarInfoViewRankButtonClick { + if (self.delegate && [self.delegate respondsToSelector:@selector(xpGiftInfoViewDidClickWeekStarRank:)]) { + [self.delegate xpGiftInfoViewDidClickWeekStarRank:self]; + } +} + #pragma mark - Getters And Setters - (void)setSegmentType:(GiftSegmentType)segmentType { if (segmentType == _segmentType) { @@ -263,8 +292,10 @@ [self resetSelectGift:self.packOriginArray]; [self resetSelectGift:self.giftLuckyArray]; [self resetSelectGift:self.giftNobleArray]; + [self resetSelectGift:self.giftWeekStarArray]; self.totalValueLabel.hidden = YES; self.nobleButton.hidden = YES; + self.weekStarView.hidden = YES; switch (_segmentType) { case GiftSegmentType_Normal: [self.datasource addObjectsFromArray:self.giftArray]; @@ -272,9 +303,15 @@ case GiftSegmentType_Lucky: [self.datasource addObjectsFromArray:self.giftLuckyArray]; break; - case GiftSegmentType_Noble: + 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: { @@ -314,6 +351,7 @@ NSMutableArray * luckyArray = [NSMutableArray array]; NSMutableArray * normaleArray = [NSMutableArray array]; NSMutableArray * nobleArray = [NSMutableArray array]; + NSMutableArray * weekStarArray = [NSMutableArray array]; [_normalOriginArray enumerateObjectsUsingBlock:^(GiftInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if (obj.giftType == GiftType_Lucky) { [luckyArray addObject:obj]; @@ -321,11 +359,14 @@ [normaleArray addObject:obj]; } else if (obj.giftType == GiftType_Noble) { [nobleArray addObject:obj]; + } else if (obj.giftType == GiftType_WeekStar) { + [weekStarArray addObject:obj]; } }]; self.giftArray = normaleArray; self.giftLuckyArray = luckyArray; self.giftNobleArray = nobleArray; + self.giftWeekStarArray = weekStarArray; self.segmentType = GiftSegmentType_Normal; } @@ -362,6 +403,14 @@ return _giftStackView; } +- (XPWeekStarInfoView *)weekStarView { + if (!_weekStarView) { + _weekStarView = [[XPWeekStarInfoView alloc] init]; + _weekStarView.delegate = self; + } + return _weekStarView; +} + - (UIButton *)normalGiftButton { if (!_normalGiftButton) { _normalGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; @@ -379,7 +428,7 @@ - (UIButton *)luckyGiftButton { if (!_luckyGiftButton) { _luckyGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_luckyGiftButton setTitle:@"幸运礼物" forState:UIControlStateNormal]; + [_luckyGiftButton setTitle:@"幸运" forState:UIControlStateNormal]; [_luckyGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_luckyGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; _luckyGiftButton.titleLabel.font = [UIFont systemFontOfSize:14]; @@ -393,7 +442,7 @@ - (UIButton *)nobleGiftButton { if (!_nobleGiftButton) { _nobleGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_nobleGiftButton setTitle:@"贵族礼物" forState:UIControlStateNormal]; + [_nobleGiftButton setTitle:@"贵族" forState:UIControlStateNormal]; [_nobleGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; [_nobleGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; _nobleGiftButton.titleLabel.font = [UIFont systemFontOfSize:14]; @@ -404,6 +453,20 @@ return _nobleGiftButton; } +- (UIButton *)weekStarButton { + if (!_weekStarButton) { + _weekStarButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_weekStarButton setTitle:@"周星" forState:UIControlStateNormal]; + [_weekStarButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected]; + [_weekStarButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal]; + _weekStarButton.titleLabel.font = [UIFont systemFontOfSize:14]; + _weekStarButton.tag = GiftSegmentType_WeekStar; + _weekStarButton.selected = NO; + [_weekStarButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _weekStarButton; +} + - (UIButton *)packGiftButton { if (!_packGiftButton) { _packGiftButton = [UIButton buttonWithType:UIButtonTypeCustom]; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m index 2aaf33a9..bced12f8 100644 --- a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPSendGiftView.m @@ -15,6 +15,7 @@ #import "TTPopup.h" #import "ThemeColor+SendGift.h" #import "StatisticsServiceHelper.h" +#import "XPHtmlUrl.h" ///Model #import "GiftInfoModel.h" #import "XPGiftCountModel.h" @@ -358,6 +359,14 @@ [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]; +} + #pragma mark - XPGiftProtocol - (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo { self.giftBarView.walletInfoModel = balanceInfo; diff --git a/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.h b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.h new file mode 100644 index 00000000..a5b6bfc9 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.h @@ -0,0 +1,32 @@ +// +// 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, strong) XPWeekStarRankUserModel *firstCharmRankUser; +///上周对应礼物豪气榜第一 +@property (nonatomic, strong) XPWeekStarRankUserModel *firstLevelRankUser; + +@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 new file mode 100644 index 00000000..01363d90 --- /dev/null +++ b/xplan-ios/Main/ModuleKit/SendGiftView/View/XPWeekStarInfoView.m @@ -0,0 +1,178 @@ +// +// 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) UILabel *charmTitleLabel; +///神豪标题 +@property (nonatomic, strong) UILabel *contributeTitleLabel; +///冠名者 +@property (nonatomic, strong) UILabel *charmLabel; +///神豪 +@property (nonatomic, strong) UILabel *contributeLabel; +///周星版入口 +@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.charmTitleLabel]; + [self addSubview:self.contributeTitleLabel]; + [self addSubview:self.charmLabel]; + [self addSubview:self.contributeLabel]; + [self addSubview:self.entranceButton]; + [self addSubview:self.arrowImageView]; +} + +- (void)initSubViewConstraints { + [self.charmTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.mas_equalTo(0); + make.height.mas_equalTo(14); + }]; + [self.charmLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.charmTitleLabel.mas_right); + make.centerY.mas_equalTo(self.charmTitleLabel); + }]; + + [self.contributeTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.charmLabel.mas_right).mas_offset(16); + make.centerY.mas_equalTo(self.charmTitleLabel); + }]; + + [self.contributeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.contributeTitleLabel.mas_right); + make.centerY.mas_equalTo(self.charmTitleLabel); + }]; + + [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.charmTitleLabel); + }]; + [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.charmTitleLabel); + }]; +} + +#pragma mark - events +- (void)didClickWeekStarRank:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPWeekStarInfoViewRankButtonClick)]) { + [self.delegate xPWeekStarInfoViewRankButtonClick]; + } +} + +#pragma mark - getter and setter +- (void)setFirstCharmRankUser:(XPWeekStarRankUserModel *)firstCharmRankUser { + NSString *nickStr = firstCharmRankUser.nick; + if (firstCharmRankUser.nick.length > 5) { + nickStr = [NSString stringWithFormat:@"%@…", [firstCharmRankUser.nick substringToIndex:5]]; + } else if(!firstCharmRankUser.nick.length) { + nickStr = @""; + } + self.charmLabel.text = nickStr; +} + +- (void)setFirstLevelRankUser:(XPWeekStarRankUserModel *)firstLevelRankUser { + NSString *nickStr = firstLevelRankUser.nick; + if (firstLevelRankUser.nick.length > 5) { + nickStr = [NSString stringWithFormat:@"%@…", [firstLevelRankUser.nick substringToIndex:5]]; + } else if(!firstLevelRankUser.nick.length) { + nickStr = @""; + } + self.contributeLabel.text = nickStr; +} + +- (UILabel *)charmTitleLabel { + if (!_charmTitleLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [ThemeColor giftSegmentNormalTitleColor]; + label.text = @"本周冠名者:"; + _charmTitleLabel = label; + } + return _charmTitleLabel; +} + +- (UILabel *)contributeTitleLabel { + if (!_contributeTitleLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [ThemeColor giftSegmentNormalTitleColor]; + label.text = @"周星神豪:"; + _contributeTitleLabel = label; + } + return _contributeTitleLabel; +} + +- (UILabel *)charmLabel { + if (!_charmLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [ThemeColor giftSegmentSelectTitleColor]; + _charmLabel = label; + } + return _charmLabel; +} + +- (UILabel *)contributeLabel { + if (!_contributeLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:10]; + label.textColor = [ThemeColor giftSegmentSelectTitleColor]; + _contributeLabel = label; + } + return _contributeLabel; +} + +- (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 diff --git a/xplan-ios/Main/Room/Presenter/XPRoomPresenter.m b/xplan-ios/Main/Room/Presenter/XPRoomPresenter.m index 63dbecc3..8c452c4a 100644 --- a/xplan-ios/Main/Room/Presenter/XPRoomPresenter.m +++ b/xplan-ios/Main/Room/Presenter/XPRoomPresenter.m @@ -152,12 +152,14 @@ NSArray *vipGift = [GiftInfoModel modelsWithArray:data.data[@"vipGift"]]; // 贵族礼物 NSArray *luckyPoolGift = [GiftInfoModel modelsWithArray:data.data[@"luckyPoolGift"]];// 福袋奖池礼物 NSArray *normalGift = [GiftInfoModel modelsWithArray:data.data[@"normalGift"]]; // 普通面板礼物 + NSArray *weekStarGift = [GiftInfoModel modelsWithArray:data.data[@"weekStarGift"]]; // 周星礼物 //TODO: luckyPoolGift 这个就是福袋礼物的所有的数据 只要保存这个就行了吧 以后需要改 NSMutableArray *info = [NSMutableArray array]; NSMutableArray *totalInfo = [NSMutableArray array]; [info addObjectsFromArray:luckyBagGift]; [info addObjectsFromArray:vipGift]; [info addObjectsFromArray:normalGift]; + [info addObjectsFromArray:weekStarGift]; [totalInfo addObjectsFromArray:info]; [totalInfo addObjectsFromArray:luckyPoolGift]; ///把礼物信息保存一下