年度礼物飘屏

This commit is contained in:
chenguilong
2022-11-26 19:24:46 +08:00
parent 49458c26bc
commit 4c8364bd33
13 changed files with 343 additions and 12 deletions

View File

@@ -132,24 +132,17 @@ DEPENDENCIES:
SPEC REPOS: SPEC REPOS:
https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git: https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git:
- Bugly
- CocoaAsyncSocket
- IQKeyboardManager
- JXPagingView
- NIMSDK_LITE
- NTESBaseComponent
- NTESQuickPass
- QGVAPlayer
- TXLiteAVSDK_TRTC
- TZImagePickerController
trunk:
- AFNetworking - AFNetworking
- AgoraRtcEngine_iOS - AgoraRtcEngine_iOS
- Base64 - Base64
- Bugly
- CocoaAsyncSocket
- FFPopup - FFPopup
- HappyDNS - HappyDNS
- IAPHelper - IAPHelper
- IQKeyboardManager
- JXCategoryView - JXCategoryView
- JXPagingView
- LookinServer - LookinServer
- MarqueeLabel-ObjC - MarqueeLabel-ObjC
- Masonry - Masonry
@@ -158,8 +151,12 @@ SPEC REPOS:
- MJRefresh - MJRefresh
- mob_sharesdk - mob_sharesdk
- MOBFoundation - MOBFoundation
- NIMSDK_LITE
- NTESBaseComponent
- NTESQuickPass
- pop - pop
- Protobuf - Protobuf
- QGVAPlayer
- Qiniu - Qiniu
- ReactiveObjC - ReactiveObjC
- SDCycleScrollView - SDCycleScrollView
@@ -168,6 +165,8 @@ SPEC REPOS:
- SSZipArchive - SSZipArchive
- SVGAPlayer - SVGAPlayer
- SZTextView - SZTextView
- TXLiteAVSDK_TRTC
- TZImagePickerController
- UMCommon - UMCommon
- UMDevice - UMDevice
- YYCache - YYCache

View File

@@ -1221,6 +1221,7 @@
E8F9168727EC927C00F10D8F /* XPHomeLittleGamePesenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168627EC927C00F10D8F /* XPHomeLittleGamePesenter.m */; }; E8F9168727EC927C00F10D8F /* XPHomeLittleGamePesenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168627EC927C00F10D8F /* XPHomeLittleGamePesenter.m */; };
E8F9168B27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */; }; E8F9168B27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */; };
E8F9168E27ECA69500F10D8F /* HomeLittleGameRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F9168D27ECA69500F10D8F /* HomeLittleGameRoomModel.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 */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
@@ -3513,6 +3514,8 @@
E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLittleGameTableViewCell.m; sourceTree = "<group>"; }; E8F9168A27EC940E00F10D8F /* XPHomeLittleGameTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLittleGameTableViewCell.m; sourceTree = "<group>"; };
E8F9168C27ECA69500F10D8F /* HomeLittleGameRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeLittleGameRoomModel.h; sourceTree = "<group>"; }; E8F9168C27ECA69500F10D8F /* HomeLittleGameRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeLittleGameRoomModel.h; sourceTree = "<group>"; };
E8F9168D27ECA69500F10D8F /* HomeLittleGameRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeLittleGameRoomModel.m; sourceTree = "<group>"; }; E8F9168D27ECA69500F10D8F /* HomeLittleGameRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeLittleGameRoomModel.m; sourceTree = "<group>"; };
F1D8556D2931FC86008C418F /* XPRoomYearActivityView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomYearActivityView.h; sourceTree = "<group>"; };
F1D8556E2931FC86008C418F /* XPRoomYearActivityView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomYearActivityView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@@ -6198,6 +6201,8 @@
E8E21A9A28B4BD92008F7C9D /* XPRoomGraffitiGiftAnimationView.m */, E8E21A9A28B4BD92008F7C9D /* XPRoomGraffitiGiftAnimationView.m */,
9BC9DAED27E33B3F009EE409 /* XPRoomGiftAnimationParser.h */, 9BC9DAED27E33B3F009EE409 /* XPRoomGiftAnimationParser.h */,
9BC9DAEE27E33B3F009EE409 /* XPRoomGiftAnimationParser.m */, 9BC9DAEE27E33B3F009EE409 /* XPRoomGiftAnimationParser.m */,
F1D8556D2931FC86008C418F /* XPRoomYearActivityView.h */,
F1D8556E2931FC86008C418F /* XPRoomYearActivityView.m */,
); );
path = AnimationView; path = AnimationView;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -9452,6 +9457,7 @@
E855514E2805152B005F293F /* XPGuildTimePickView.m in Sources */, E855514E2805152B005F293F /* XPGuildTimePickView.m in Sources */,
9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */, 9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */,
E83ABF00280EC45700322EE4 /* MessageContentApplicationShareView.m in Sources */, E83ABF00280EC45700322EE4 /* MessageContentApplicationShareView.m in Sources */,
F1D8556F2931FC86008C418F /* XPRoomYearActivityView.m in Sources */,
E8B9843628ABA8B40022D026 /* XPMonentPublishSuccessView.m in Sources */, E8B9843628ABA8B40022D026 /* XPMonentPublishSuccessView.m in Sources */,
E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */, E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */,
E8E5E19727C36BE700F457D8 /* XPHomeRecommendTableViewCell.m in Sources */, E8E5E19727C36BE700F457D8 /* XPHomeRecommendTableViewCell.m in Sources */,

View File

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

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View File

@@ -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
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -41,6 +41,8 @@ typedef NS_ENUM(NSInteger, BroadCastLevel) {
@property (nonatomic,assign) NSInteger roomUid; @property (nonatomic,assign) NSInteger roomUid;
///平台id ///平台id
@property (nonatomic,copy) NSString *roomErbanNo; @property (nonatomic,copy) NSString *roomErbanNo;
///是否年度飘屏
@property (nonatomic, assign) BOOL ceremonyGift;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -15,6 +15,7 @@
#import "XPRoomGiftBroadCastModel.h" #import "XPRoomGiftBroadCastModel.h"
///View ///View
#import "NetImageView.h" #import "NetImageView.h"
#import "XPRoomYearActivityView.h"
#define kScreenScale (CGFloat)KScreenWidth / (CGFloat)375 #define kScreenScale (CGFloat)KScreenWidth / (CGFloat)375
@@ -103,7 +104,7 @@
@end @end
@interface XPRoomGiftBroadcastView () @interface XPRoomGiftBroadcastView ()<XPRoomYearActivityViewDelegate>
/// ///
@property (nonatomic,strong) UIImageView *backImageView; @property (nonatomic,strong) UIImageView *backImageView;
/// ///
@@ -120,6 +121,8 @@
@property (nonatomic,strong) UIButton *closeButton; @property (nonatomic,strong) UIButton *closeButton;
///iD ///iD
@property (nonatomic,strong) UILabel *roomIdLabel; @property (nonatomic,strong) UILabel *roomIdLabel;
///
@property (nonatomic, strong) XPRoomYearActivityView *ceremonyView;
@end @end
@implementation XPRoomGiftBroadcastView @implementation XPRoomGiftBroadcastView
@@ -290,6 +293,13 @@
self.backImageView.image = [UIImage imageNamed:bgImageName]; 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 #pragma mark - Getters And Setters
- (void)setBroadcastModel:(XPRoomGiftBroadCastModel *)broadcastModel { - (void)setBroadcastModel:(XPRoomGiftBroadCastModel *)broadcastModel {
@@ -298,6 +308,20 @@
if (broadcastModel.sendUserNick.length > 6) { if (broadcastModel.sendUserNick.length > 6) {
broadcastModel.sendUserNick = [broadcastModel.sendUserNick substringToIndex: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.avatarImageView.imageUrl = broadcastModel.sendUserAvatar;
[self.sendView.nickButton setTitle:broadcastModel.sendUserNick forState:UIControlStateNormal]; [self.sendView.nickButton setTitle:broadcastModel.sendUserNick forState:UIControlStateNormal];
@@ -383,5 +407,12 @@
return _roomIdLabel; return _roomIdLabel;
} }
- (XPRoomYearActivityView *)ceremonyView {
if(!_ceremonyView) {
_ceremonyView = [[XPRoomYearActivityView alloc] init];
_ceremonyView.delegate = self;
}
return _ceremonyView;
}
@end @end

View File

@@ -0,0 +1,29 @@
//
// XPRoomYearActivityView.h
// xplan-ios
//
// Created by GLEN on 2022/11/26.
// 年度活动
#import <UIKit/UIKit.h>
#import "XPRoomGiftBroadCastModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol XPRoomYearActivityViewDelegate <NSObject>
///点击了进入房间
- (void)xPRoomYearActivityViewEnterRoom:(NSString *)roomUid;
@end
@interface XPRoomYearActivityView : UIView
@property (nonatomic, strong) XPRoomGiftBroadCastModel *model;
///代理
@property (nonatomic,weak) id<XPRoomYearActivityViewDelegate> delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,214 @@
//
// XPRoomYearActivityView.m
// xplan-ios
//
// Created by GLEN on 2022/11/26.
//
#import "XPRoomYearActivityView.h"
///Third
#import <Masonry/Masonry.h>
///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