diff --git a/Podfile.lock b/Podfile.lock index 9d405a27..5a57179a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -132,24 +132,17 @@ DEPENDENCIES: SPEC REPOS: https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git: - - Bugly - - CocoaAsyncSocket - - IQKeyboardManager - - JXPagingView - - NIMSDK_LITE - - NTESBaseComponent - - NTESQuickPass - - QGVAPlayer - - TXLiteAVSDK_TRTC - - TZImagePickerController - trunk: - AFNetworking - AgoraRtcEngine_iOS - Base64 + - Bugly + - CocoaAsyncSocket - FFPopup - HappyDNS - IAPHelper + - IQKeyboardManager - JXCategoryView + - JXPagingView - LookinServer - MarqueeLabel-ObjC - Masonry @@ -158,8 +151,12 @@ SPEC REPOS: - MJRefresh - mob_sharesdk - MOBFoundation + - NIMSDK_LITE + - NTESBaseComponent + - NTESQuickPass - pop - Protobuf + - QGVAPlayer - Qiniu - ReactiveObjC - SDCycleScrollView @@ -168,6 +165,8 @@ SPEC REPOS: - SSZipArchive - SVGAPlayer - SZTextView + - TXLiteAVSDK_TRTC + - TZImagePickerController - UMCommon - UMDevice - YYCache diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 9e6fbecf..6713786a 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -1221,6 +1221,7 @@ E8F9168727EC927C00F10D8F /* XPHomeLittleGamePesenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168627EC927C00F10D8F /* XPHomeLittleGamePesenter.m */; }; E8F9168B27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */; }; E8F9168E27ECA69500F10D8F /* HomeLittleGameRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168D27ECA69500F10D8F /* HomeLittleGameRoomModel.m */; }; + F1D8556F2931FC86008C418F /* XPRoomYearActivityView.m in Sources */ = {isa = PBXBuildFile; fileRef = F1D8556E2931FC86008C418F /* XPRoomYearActivityView.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -3513,6 +3514,8 @@ E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLittleGameTableViewCell.m; sourceTree = ""; }; E8F9168C27ECA69500F10D8F /* HomeLittleGameRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeLittleGameRoomModel.h; sourceTree = ""; }; E8F9168D27ECA69500F10D8F /* HomeLittleGameRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeLittleGameRoomModel.m; sourceTree = ""; }; + F1D8556D2931FC86008C418F /* XPRoomYearActivityView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomYearActivityView.h; sourceTree = ""; }; + F1D8556E2931FC86008C418F /* XPRoomYearActivityView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomYearActivityView.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -6198,6 +6201,8 @@ E8E21A9A28B4BD92008F7C9D /* XPRoomGraffitiGiftAnimationView.m */, 9BC9DAED27E33B3F009EE409 /* XPRoomGiftAnimationParser.h */, 9BC9DAEE27E33B3F009EE409 /* XPRoomGiftAnimationParser.m */, + F1D8556D2931FC86008C418F /* XPRoomYearActivityView.h */, + F1D8556E2931FC86008C418F /* XPRoomYearActivityView.m */, ); path = AnimationView; sourceTree = ""; @@ -9452,6 +9457,7 @@ E855514E2805152B005F293F /* XPGuildTimePickView.m in Sources */, 9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */, E83ABF00280EC45700322EE4 /* MessageContentApplicationShareView.m in Sources */, + F1D8556F2931FC86008C418F /* XPRoomYearActivityView.m in Sources */, E8B9843628ABA8B40022D026 /* XPMonentPublishSuccessView.m in Sources */, E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */, E8E5E19727C36BE700F457D8 /* XPHomeRecommendTableViewCell.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Room/YearActivity/Contents.json b/xplan-ios/Assets.xcassets/Room/YearActivity/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/YearActivity/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/Contents.json new file mode 100644 index 00000000..095db9ca --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "YearActivity_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "YearActivity_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/YearActivity_bg@2x.png b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/YearActivity_bg@2x.png new file mode 100644 index 00000000..8b2a1bee Binary files /dev/null and b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/YearActivity_bg@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/YearActivity_bg@3x.png b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/YearActivity_bg@3x.png new file mode 100644 index 00000000..d911f156 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_bg.imageset/YearActivity_bg@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/Contents.json new file mode 100644 index 00000000..5d330ba1 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "YearActivity_goto@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "YearActivity_goto@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/YearActivity_goto@2x.png b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/YearActivity_goto@2x.png new file mode 100644 index 00000000..e83eb8d2 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/YearActivity_goto@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/YearActivity_goto@3x.png b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/YearActivity_goto@3x.png new file mode 100644 index 00000000..d669e8cc Binary files /dev/null and b/xplan-ios/Assets.xcassets/Room/YearActivity/YearActivity_goto.imageset/YearActivity_goto@3x.png differ diff --git a/xplan-ios/Main/Room/View/AnimationView/Model/XPRoomGiftBroadCastModel.h b/xplan-ios/Main/Room/View/AnimationView/Model/XPRoomGiftBroadCastModel.h index 87ec1230..0fab9992 100644 --- a/xplan-ios/Main/Room/View/AnimationView/Model/XPRoomGiftBroadCastModel.h +++ b/xplan-ios/Main/Room/View/AnimationView/Model/XPRoomGiftBroadCastModel.h @@ -41,6 +41,8 @@ typedef NS_ENUM(NSInteger, BroadCastLevel) { @property (nonatomic,assign) NSInteger roomUid; ///平台id @property (nonatomic,copy) NSString *roomErbanNo; +///是否年度飘屏 +@property (nonatomic, assign) BOOL ceremonyGift; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/AnimationView/XPRoomGiftBroadcastView.m b/xplan-ios/Main/Room/View/AnimationView/XPRoomGiftBroadcastView.m index a995b23d..a7508653 100644 --- a/xplan-ios/Main/Room/View/AnimationView/XPRoomGiftBroadcastView.m +++ b/xplan-ios/Main/Room/View/AnimationView/XPRoomGiftBroadcastView.m @@ -15,6 +15,7 @@ #import "XPRoomGiftBroadCastModel.h" ///View #import "NetImageView.h" +#import "XPRoomYearActivityView.h" #define kScreenScale (CGFloat)KScreenWidth / (CGFloat)375 @@ -103,7 +104,7 @@ @end -@interface XPRoomGiftBroadcastView () +@interface XPRoomGiftBroadcastView () ///背景 @property (nonatomic,strong) UIImageView *backImageView; ///赠送者 @@ -120,6 +121,8 @@ @property (nonatomic,strong) UIButton *closeButton; ///房间iD @property (nonatomic,strong) UILabel *roomIdLabel; +///庆典 +@property (nonatomic, strong) XPRoomYearActivityView *ceremonyView; @end @implementation XPRoomGiftBroadcastView @@ -290,6 +293,13 @@ self.backImageView.image = [UIImage imageNamed:bgImageName]; } +#pragma mark - XPRoomYearActivityViewDelegate +///点击了进入房间 +- (void)xPRoomYearActivityViewEnterRoom:(NSString *)roomUid { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomGiftBroadcastView:enterRoom:)]) { + [self.delegate xPRoomGiftBroadcastView:self enterRoom:roomUid]; + } +} #pragma mark - Getters And Setters - (void)setBroadcastModel:(XPRoomGiftBroadCastModel *)broadcastModel { @@ -298,6 +308,20 @@ if (broadcastModel.sendUserNick.length > 6) { broadcastModel.sendUserNick = [broadcastModel.sendUserNick substringToIndex:6]; } + if(broadcastModel.ceremonyGift) { + for (UIView *subView in self.subviews) { + [subView removeFromSuperview]; + } + [self addSubview:self.ceremonyView]; + CGFloat kscale = (CGFloat)90/ (CGFloat)375; + CGFloat width = KScreenWidth; + [self.ceremonyView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.right.mas_equalTo(self); + make.height.mas_equalTo(width * kscale); + }]; + self.ceremonyView.model = broadcastModel; + return; + } self.sendView.avatarImageView.imageUrl = broadcastModel.sendUserAvatar; [self.sendView.nickButton setTitle:broadcastModel.sendUserNick forState:UIControlStateNormal]; @@ -383,5 +407,12 @@ return _roomIdLabel; } +- (XPRoomYearActivityView *)ceremonyView { + if(!_ceremonyView) { + _ceremonyView = [[XPRoomYearActivityView alloc] init]; + _ceremonyView.delegate = self; + } + return _ceremonyView; +} @end diff --git a/xplan-ios/Main/Room/View/AnimationView/XPRoomYearActivityView.h b/xplan-ios/Main/Room/View/AnimationView/XPRoomYearActivityView.h new file mode 100644 index 00000000..4f9f76b2 --- /dev/null +++ b/xplan-ios/Main/Room/View/AnimationView/XPRoomYearActivityView.h @@ -0,0 +1,29 @@ +// +// XPRoomYearActivityView.h +// xplan-ios +// +// Created by GLEN on 2022/11/26. +// 年度活动 + +#import +#import "XPRoomGiftBroadCastModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@protocol XPRoomYearActivityViewDelegate + +///点击了进入房间 +- (void)xPRoomYearActivityViewEnterRoom:(NSString *)roomUid; + +@end + +@interface XPRoomYearActivityView : UIView + +@property (nonatomic, strong) XPRoomGiftBroadCastModel *model; +///代理 +@property (nonatomic,weak) id delegate; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/AnimationView/XPRoomYearActivityView.m b/xplan-ios/Main/Room/View/AnimationView/XPRoomYearActivityView.m new file mode 100644 index 00000000..e4cfe613 --- /dev/null +++ b/xplan-ios/Main/Room/View/AnimationView/XPRoomYearActivityView.m @@ -0,0 +1,214 @@ +// +// XPRoomYearActivityView.m +// xplan-ios +// +// Created by GLEN on 2022/11/26. +// + +#import "XPRoomYearActivityView.h" +///Third +#import +///Tool +#import "ThemeColor+Room.h" +#import "ThemeColor.h" +#import "XPMacro.h" +///Model +#import "RoomHalfHourRankModel.h" +///View +#import "NetImageView.h" + +@interface XPRoomYearActivityView() + +///背景 +@property (nonatomic,strong) UIImageView *bgImageView; +///icon +@property (nonatomic,strong) NetImageView *sendAvatar; +///头像 +@property (nonatomic,strong) NetImageView *receiveAvatar; +///恭喜 +@property (nonatomic,strong) UILabel *sendNick; +///昵称 +@property (nonatomic,strong) UILabel *receiveNick; +///描述 +@property (nonatomic, strong) UILabel *descLabel; +///数量 +@property (nonatomic,strong) UILabel *countLabel; +///排行 +@property (nonatomic, strong) UIButton *gotoButton; + +@end + +@implementation XPRoomYearActivityView + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +- (void)layoutSubviews { + [super layoutSubviews]; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self addSubview:self.bgImageView]; + [self addSubview:self.sendNick]; + [self addSubview:self.sendAvatar]; + [self addSubview:self.descLabel]; + [self addSubview:self.receiveNick]; + [self addSubview:self.receiveAvatar]; + [self addSubview:self.countLabel]; + [self addSubview:self.gotoButton]; +} + +- (void)initSubViewConstraints { + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(0); + }]; + [self.sendNick mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(35*KScreenWidth/375); + make.centerY.mas_equalTo(self.bgImageView); + }]; + [self.sendAvatar mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.sendNick.mas_right).mas_offset(3); + make.centerY.mas_equalTo(self); + make.width.height.mas_equalTo(20); + }]; + [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.sendAvatar.mas_right).mas_offset(3); + make.centerY.mas_equalTo(self); + }]; + [self.receiveNick mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.descLabel.mas_right).mas_offset(3); + make.centerY.mas_equalTo(self); + }]; + [self.receiveAvatar mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.receiveNick.mas_right).mas_offset(3); + make.centerY.mas_equalTo(self); + make.width.height.mas_equalTo(20); + }]; + [self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.receiveAvatar.mas_right).mas_offset(3); + make.centerY.mas_equalTo(self); + }]; + [self.gotoButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-31*KScreenWidth / 375); + make.centerY.mas_equalTo(self); + make.size.mas_equalTo(CGSizeMake(40, 18)); + }]; +} + +- (void)setModel:(XPRoomGiftBroadCastModel *)model { + _model = model; + if (model) { + self.receiveAvatar.imageUrl = model.recvUserAvatar; + self.sendAvatar.imageUrl = model.sendUserAvatar; + if (model.recvUserNick.length > 4) { + model.recvUserNick = [model.recvUserNick substringToIndex:4]; + } + if (model.sendUserNick.length > 4) { + model.sendUserNick = [model.sendUserNick substringToIndex:4]; + } + if (model.giftName.length > 6) { + model.giftName = [model.giftName substringToIndex:6]; + } + self.sendNick.text = model.sendUserNick; + self.receiveNick.text = model.recvUserNick; + self.countLabel.text = [NSString stringWithFormat:@"%@ x%ld", model.giftName, model.giftNum]; + } +} + +- (void)onGotoButtonClick:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomYearActivityViewEnterRoom:)]) { + [self.delegate xPRoomYearActivityViewEnterRoom:[NSString stringWithFormat:@"%ld", self.model.roomUid]]; + } +} + +#pragma mark - Getters And Setters +- (UIImageView *)bgImageView { + if (!_bgImageView) { + _bgImageView = [[UIImageView alloc] init]; + _bgImageView.image = [UIImage imageNamed:@"YearActivity_bg"]; + _bgImageView.contentMode = UIViewContentModeScaleAspectFit; + } + return _bgImageView; +} + +- (NetImageView *)sendAvatar { + if (!_sendAvatar) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + _sendAvatar = [[NetImageView alloc] initWithConfig:config]; + _sendAvatar.layer.masksToBounds = YES; + _sendAvatar.layer.cornerRadius = 10; + _sendAvatar.layer.borderColor = UIColorFromRGB(0xFBC200).CGColor; + _sendAvatar.layer.borderWidth = 1; + } + return _sendAvatar; +} + +- (UILabel *)sendNick { + if (!_sendNick) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:12]; + label.textColor = UIColorFromRGB(0xFBC200); + _sendNick = label; + } + return _sendNick; +} + +- (NetImageView *)receiveAvatar { + if (!_receiveAvatar) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + _receiveAvatar = [[NetImageView alloc] initWithConfig:config]; + _receiveAvatar.layer.masksToBounds = YES; + _receiveAvatar.layer.cornerRadius = 10; + _receiveAvatar.layer.borderColor = UIColorFromRGB(0xFBC200).CGColor; + _receiveAvatar.layer.borderWidth = 1; + } + return _receiveAvatar; +} + +- (UILabel *)receiveNick { + if (!_receiveNick) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:12]; + label.textColor = UIColorFromRGB(0xFBC200); + _receiveNick = label; + } + return _receiveNick; +} + +- (UILabel *)descLabel { + if (!_descLabel) { + UILabel *label = [[UILabel alloc] init]; + label.font = [UIFont systemFontOfSize:12]; + label.textColor = [UIColor whiteColor]; + label.text = @"送给"; + _descLabel = label; + } + return _descLabel; +} + +- (UILabel *)countLabel { + if (!_countLabel) { + _countLabel = [[UILabel alloc] init]; + _countLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightBold]; + _countLabel.textColor = UIColorFromRGB(0x80F9FF); + } + return _countLabel; +} +- (UIButton *)gotoButton { + if (!_gotoButton) { + _gotoButton = [[UIButton alloc] init]; + [_gotoButton setBackgroundImage:[UIImage imageNamed:@"YearActivity_goto"] forState:UIControlStateNormal]; + [_gotoButton addTarget:self action:@selector(onGotoButtonClick:) forControlEvents:UIControlEventTouchUpInside]; + } + return _gotoButton; +} + +@end