feat(EventCenter): 添加活动中心模块

新增活动中心模块,包括官方活动、活动广场和我的活动三个页面。支持活动列表展示、倒计时功能及创建活动按钮。优化了页面切换和UI交互体验。
This commit is contained in:
AI Health Developer
2025-05-06 16:45:34 +08:00
parent a9538c61ff
commit 69863a91ff
40 changed files with 1065 additions and 97 deletions

View File

@@ -8,6 +8,13 @@
],
"cSpell.words": [
"autoreleasepool",
"Subview"
"Bugly",
"MSRTL",
"NIMSDK",
"Nonnull",
"NSEC",
"Subview",
"Superview",
"Uids"
]
}

View File

@@ -533,6 +533,10 @@
4CACCCE42D9A695000CCB135 /* brove_gift.svga in Resources */ = {isa = PBXBuildFile; fileRef = 4CACCCE32D9A695000CCB135 /* brove_gift.svga */; };
4CB753D22D30F10900B13DF5 /* LuckyPackageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB753D12D30F10900B13DF5 /* LuckyPackageViewController.m */; };
4CBBB44C2DA66334001B1C6D /* MessageCPNotifyModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBBB44B2DA66334001B1C6D /* MessageCPNotifyModel.m */; };
4CBDC4242DC0B078005A75B9 /* EventCenterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBDC4232DC0B078005A75B9 /* EventCenterViewController.m */; };
4CBDC4272DC0B947005A75B9 /* EventCenterPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBDC4262DC0B947005A75B9 /* EventCenterPresenter.m */; };
4CBDC42A2DC0BB95005A75B9 /* EventCenterOfficialCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBDC4292DC0BB95005A75B9 /* EventCenterOfficialCell.m */; };
4CBDC42D2DC0BBB7005A75B9 /* EventCenterEventCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBDC42C2DC0BBB7005A75B9 /* EventCenterEventCell.m */; };
4CC312242D7987A200F57A07 /* ShareHelder.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC312232D7987A200F57A07 /* ShareHelder.m */; };
4CC312272D79A10100F57A07 /* ShareProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC312262D79A10100F57A07 /* ShareProvider.m */; };
4CC6195A2CEC7770008C1EE8 /* MyDressingDataPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC619592CEC7770008C1EE8 /* MyDressingDataPresent.m */; };
@@ -2699,6 +2703,14 @@
4CB753D12D30F10900B13DF5 /* LuckyPackageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LuckyPackageViewController.m; sourceTree = "<group>"; };
4CBBB44A2DA66334001B1C6D /* MessageCPNotifyModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageCPNotifyModel.h; sourceTree = "<group>"; };
4CBBB44B2DA66334001B1C6D /* MessageCPNotifyModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageCPNotifyModel.m; sourceTree = "<group>"; };
4CBDC4222DC0B078005A75B9 /* EventCenterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EventCenterViewController.h; sourceTree = "<group>"; };
4CBDC4232DC0B078005A75B9 /* EventCenterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EventCenterViewController.m; sourceTree = "<group>"; };
4CBDC4252DC0B947005A75B9 /* EventCenterPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EventCenterPresenter.h; sourceTree = "<group>"; };
4CBDC4262DC0B947005A75B9 /* EventCenterPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EventCenterPresenter.m; sourceTree = "<group>"; };
4CBDC4282DC0BB95005A75B9 /* EventCenterOfficialCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EventCenterOfficialCell.h; sourceTree = "<group>"; };
4CBDC4292DC0BB95005A75B9 /* EventCenterOfficialCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EventCenterOfficialCell.m; sourceTree = "<group>"; };
4CBDC42B2DC0BBB7005A75B9 /* EventCenterEventCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EventCenterEventCell.h; sourceTree = "<group>"; };
4CBDC42C2DC0BBB7005A75B9 /* EventCenterEventCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EventCenterEventCell.m; sourceTree = "<group>"; };
4CC312222D7987A200F57A07 /* ShareHelder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareHelder.h; sourceTree = "<group>"; };
4CC312232D7987A200F57A07 /* ShareHelder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareHelder.m; sourceTree = "<group>"; };
4CC312252D79A10100F57A07 /* ShareProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareProvider.h; sourceTree = "<group>"; };
@@ -10015,6 +10027,8 @@
E87E627A2A3F5A0D002F68C9 /* XPNewHomeRecommendPresenter.m */,
54C3895D2C2189DD00FD47B1 /* XPHomeMinePresenter.h */,
54C3895E2C2189DD00FD47B1 /* XPHomeMinePresenter.m */,
4CBDC4252DC0B947005A75B9 /* EventCenterPresenter.h */,
4CBDC4262DC0B947005A75B9 /* EventCenterPresenter.m */,
);
path = Presenter;
sourceTree = "<group>";
@@ -10039,6 +10053,8 @@
23B8D8D72B85F8B900CA472F /* PIHoemCategoryTitleCell.m */,
541DD9532C1EDEFB00B616C4 /* XPHomePagingViewController.h */,
541DD9542C1EDEFB00B616C4 /* XPHomePagingViewController.m */,
4CBDC4222DC0B078005A75B9 /* EventCenterViewController.h */,
4CBDC4232DC0B078005A75B9 /* EventCenterViewController.m */,
);
path = View;
sourceTree = "<group>";
@@ -10129,6 +10145,10 @@
E87E62702A3F5907002F68C9 /* XPNewHomeRecommendTableViewCell.m */,
23FF42612AA5861E0055733C /* XPNewHomePartyCollectionViewCell.h */,
23FF42622AA5861E0055733C /* XPNewHomePartyCollectionViewCell.m */,
4CBDC4282DC0BB95005A75B9 /* EventCenterOfficialCell.h */,
4CBDC4292DC0BB95005A75B9 /* EventCenterOfficialCell.m */,
4CBDC42B2DC0BBB7005A75B9 /* EventCenterEventCell.h */,
4CBDC42C2DC0BBB7005A75B9 /* EventCenterEventCell.m */,
);
path = Cell;
sourceTree = "<group>";
@@ -12013,6 +12033,7 @@
E823E38E290BE8BD00EADD86 /* WishGiftInfoUpdateModel.m in Sources */,
E80EC80A28ACD84000D133C5 /* QEmotionBoardView.m in Sources */,
235A451A2B04A352009753F5 /* PIRoomActivityWebView.m in Sources */,
4CBDC4242DC0B078005A75B9 /* EventCenterViewController.m in Sources */,
E8998D962859DD6F00C68558 /* UIView+Corner.m in Sources */,
E8EEB91126FC6AE2007C6EBA /* XPMineUserInfoEditProtocol.h in Sources */,
E87E625D2A3F5622002F68C9 /* XPNewHomeViewController.m in Sources */,
@@ -12486,6 +12507,7 @@
23FF42632AA5861E0055733C /* XPNewHomePartyCollectionViewCell.m in Sources */,
E85E7B422A4EB0D300B6D00A /* XPMinePromptWindow.m in Sources */,
14EB640929A5BDDD00A4A00B /* XPMomentsSimpleDetailViewController.m in Sources */,
4CBDC42A2DC0BB95005A75B9 /* EventCenterOfficialCell.m in Sources */,
18AAF3F0279EA59300CD7DAD /* MessageContentTextClickable.m in Sources */,
E8C6FFCC27548120004DC9F0 /* Api+Home.m in Sources */,
E8778AF52988EF2B00CF139B /* XPSessionSayHelloTableViewCell.m in Sources */,
@@ -12764,6 +12786,7 @@
E8DAC5AC2858305A00012CFD /* XPRoomMessageBubbleView.m in Sources */,
1427218929A75F6F00C7C423 /* HTTPDataResponse.m in Sources */,
E8B9843028AB90200022D026 /* XPMoentsTopicListView.m in Sources */,
4CBDC42D2DC0BBB7005A75B9 /* EventCenterEventCell.m in Sources */,
23E9EA9A2A84C39700B792F2 /* XPMineUserInfoRecordedSoundView.m in Sources */,
E8E20BDE28164D3A0033B688 /* SessionNavView.m in Sources */,
9B734F76288A92FB00CBDAA9 /* XPMineFunctionItemModel.m in Sources */,
@@ -13235,6 +13258,7 @@
E84843B227F5A0740050D365 /* XPRomPKResultTitleLabel.m in Sources */,
E80EC80F28ACD84000D133C5 /* QEmotion.m in Sources */,
E877A7EB2783E24700EFACED /* DatingStageView.m in Sources */,
4CBDC4272DC0B947005A75B9 /* EventCenterPresenter.m in Sources */,
9BD2ECDA288F867000F5CD9A /* XPMineFootPrintTableViewCell.m in Sources */,
545888332C1AFFB500897585 /* XPRoomPKPanelView.m in Sources */,
E8395339276A0CC100CF2F24 /* XPMineHeadwearTableViewCell.m in Sources */,

View File

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

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "游戏@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "矩形 3164@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "游戏@3x(1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "游戏@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "游戏@3x(2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

View File

@@ -0,0 +1,16 @@
//
// EventCenterPresenter.h
// YuMi
//
// Created by P on 2025/4/29.
//
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@interface EventCenterPresenter : BaseMvpPresenter
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// EventCenterPresenter.m
// YuMi
//
// Created by P on 2025/4/29.
//
#import "EventCenterPresenter.h"
@implementation EventCenterPresenter
@end

View File

@@ -0,0 +1,16 @@
//
// EventCenterEventCell.h
// YuMi
//
// Created by P on 2025/4/29.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface EventCenterEventCell : UITableViewCell
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,23 @@
//
// EventCenterEventCell.m
// YuMi
//
// Created by P on 2025/4/29.
//
#import "EventCenterEventCell.h"
@implementation EventCenterEventCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end

View File

@@ -0,0 +1,21 @@
//
// EventCenterOfficialCell.h
// YuMi
//
// Created by P on 2025/4/29.
//
#import <UIKit/UIKit.h>
@class HomeBannerInfoModel;
NS_ASSUME_NONNULL_BEGIN
@interface EventCenterOfficialCell : UITableViewCell
@property (nonatomic, strong) HomeBannerInfoModel *cellModel;
// 更新倒计时天数
- (void)updateCountdownWithDays:(NSInteger)days;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,239 @@
//
// EventCenterOfficialCell.m
// YuMi
//
// Created by P on 2025/4/29.
//
#import "EventCenterOfficialCell.h"
#import "HomeBannerInfoModel.h"
@interface EventCenterOfficialCell()
@property (nonatomic, strong) NetImageView *coverImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIStackView *countdownView;
@property (nonatomic, strong) UILabel *countdownPrefixLabel; // Countdown:
@property (nonatomic, strong) UILabel *daysNumberLabel; //
@property (nonatomic, strong) UILabel *hourNumberLabel; //
@property (nonatomic, strong) UILabel *minuteNumberLabel; //
@property (nonatomic, strong) UILabel *secondNumberLabel; //
@property (nonatomic, strong) UILabel *daysSuffixLabel; // days
@property (nonatomic, strong) UILabel *colonSuffixLabel_1; // ":"
@property (nonatomic, strong) UILabel *colonSuffixLabel_2; // ":"
@property (nonatomic, strong) NSTimer *countdownTimer; //
@end
@implementation EventCenterOfficialCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.contentView.backgroundColor = [UIColor whiteColor];
[self.contentView addSubview:self.coverImageView];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.countdownView];
[self.coverImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.contentView).offset(6);
make.leading.trailing.mas_equalTo(self.contentView).inset(15);
make.height.mas_equalTo(80);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.coverImageView.mas_bottom).offset(4);
make.leading.trailing.mas_equalTo(self.contentView).inset(15);
make.height.mas_equalTo(26);
}];
[self.countdownView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(0);
make.leading.trailing.mas_equalTo(self.contentView).inset(15);
make.height.mas_equalTo(26);
}];
}
return self;
}
- (void)setCellModel:(HomeBannerInfoModel *)cellModel {
_cellModel = cellModel;
self.coverImageView.imageUrl = cellModel.bannerPic;
self.titleLabel.text = cellModel.bannerName;
//
NSInteger days = 30; // cellModel
[self updateCountdownWithDays:days];
}
#pragma mark -
- (NetImageView *)coverImageView {
if (!_coverImageView) {
NetImageConfig *config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultBannerPlaceholder];
_coverImageView = [[NetImageView alloc] initWithConfig:config];
[_coverImageView setCornerRadius:12];
}
return _coverImageView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(14) textColor:UIColorFromRGB(0x313131)];
}
return _titleLabel;
}
- (UIStackView *)countdownView {
if (!_countdownView) {
_countdownView = [[UIStackView alloc] initWithArrangedSubviews:@[
self.countdownPrefixLabel,
self.daysNumberLabel,
self.daysSuffixLabel,
self.hourNumberLabel,
self.colonSuffixLabel_1,
self.minuteNumberLabel,
self.colonSuffixLabel_2,
self.secondNumberLabel,
[UIView new]
]];
_countdownView.spacing = 6;
_countdownView.backgroundColor = [UIColor clearColor];
[self.daysNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.greaterThanOrEqualTo(@30);
}];
[self.hourNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.greaterThanOrEqualTo(@30);
}];
[self.minuteNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.greaterThanOrEqualTo(@30);
}];
[self.secondNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.greaterThanOrEqualTo(@30);
}];
}
return _countdownView;
}
- (UILabel *)countdownPrefixLabel {
if (!_countdownPrefixLabel) {
_countdownPrefixLabel = [UILabel labelInitWithText:@"Countdown: " font:kFontSemibold(16) textColor:UIColorFromRGB(0xff9900)];
}
return _countdownPrefixLabel;
}
- (UILabel *)daysNumberLabel {
if (!_daysNumberLabel) {
_daysNumberLabel = [UILabel labelInitWithText:@"00" font:kFontSemibold(16) textColor:UIColorFromRGB(0xff9900)];
_daysNumberLabel.backgroundColor = [[UIColor orangeColor] colorWithAlphaComponent:0.15];
_daysNumberLabel.layer.cornerRadius = 6;
_daysNumberLabel.layer.masksToBounds = YES;
_daysNumberLabel.textAlignment = NSTextAlignmentCenter;
}
return _daysNumberLabel;
}
- (UILabel *)hourNumberLabel {
if (!_hourNumberLabel) {
_hourNumberLabel = [UILabel labelInitWithText:@"00" font:kFontSemibold(16) textColor:UIColorFromRGB(0xff9900)];
_hourNumberLabel.backgroundColor = [[UIColor orangeColor] colorWithAlphaComponent:0.15];
_hourNumberLabel.layer.cornerRadius = 6;
_hourNumberLabel.layer.masksToBounds = YES;
_hourNumberLabel.textAlignment = NSTextAlignmentCenter;
}
return _hourNumberLabel;
}
- (UILabel *)minuteNumberLabel {
if (!_minuteNumberLabel) {
_minuteNumberLabel = [UILabel labelInitWithText:@"00" font:kFontSemibold(16) textColor:UIColorFromRGB(0xff9900)];
_minuteNumberLabel.backgroundColor = [[UIColor orangeColor] colorWithAlphaComponent:0.15];
_minuteNumberLabel.layer.cornerRadius = 6;
_minuteNumberLabel.layer.masksToBounds = YES;
_minuteNumberLabel.textAlignment = NSTextAlignmentCenter;
}
return _minuteNumberLabel;
}
- (UILabel *)secondNumberLabel {
if (!_secondNumberLabel) {
_secondNumberLabel = [UILabel labelInitWithText:@"00" font:kFontSemibold(16) textColor:UIColorFromRGB(0xff9900)];
_secondNumberLabel.backgroundColor = [[UIColor orangeColor] colorWithAlphaComponent:0.15];
_secondNumberLabel.layer.cornerRadius = 6;
_secondNumberLabel.layer.masksToBounds = YES;
_secondNumberLabel.textAlignment = NSTextAlignmentCenter;
}
return _secondNumberLabel;
}
- (UILabel *)daysSuffixLabel {
if (!_daysSuffixLabel) {
_daysSuffixLabel = [UILabel labelInitWithText:@"days" font:kFontSemibold(16) textColor:UIColorFromRGB(0xff9900)];
}
return _daysSuffixLabel;
}
- (UILabel *)colonSuffixLabel_1 {
if (!_colonSuffixLabel_1) {
_colonSuffixLabel_1 = [UILabel labelInitWithText:@":" font:kFontSemibold(16) textColor:UIColorFromRGB(0xff9900)];
}
return _colonSuffixLabel_1;
}
- (UILabel *)colonSuffixLabel_2 {
if (!_colonSuffixLabel_2) {
_colonSuffixLabel_2 = [UILabel labelInitWithText:@":" font:kFontSemibold(16) textColor:UIColorFromRGB(0xff9900)];
}
return _colonSuffixLabel_2;
}
- (void)updateCountdownWithDays:(NSInteger)days {
//
self.daysNumberLabel.text = [NSString stringWithFormat:@"%02ld", (long)days];
//
[self stopCountdownTimer];
// 0
if (days > 0) {
[self startCountdownTimerWithDays:days];
}
}
- (void)startCountdownTimerWithDays:(NSInteger)days {
//
//
self.countdownTimer = [NSTimer scheduledTimerWithTimeInterval:86400 target:self selector:@selector(updateDaysCount) userInfo:nil repeats:YES];
}
- (void)updateDaysCount {
//
NSInteger currentDays = [self.daysNumberLabel.text integerValue];
// 0
if (currentDays > 0) {
currentDays--;
self.daysNumberLabel.text = [NSString stringWithFormat:@"%02ld", (long)currentDays];
}
// 0
if (currentDays == 0) {
[self stopCountdownTimer];
}
}
- (void)stopCountdownTimer {
if (self.countdownTimer && [self.countdownTimer isValid]) {
[self.countdownTimer invalidate];
self.countdownTimer = nil;
}
}
- (void)dealloc {
// Cell
[self stopCountdownTimer];
}
@end

View File

@@ -164,15 +164,25 @@
}
-(void)setItemModel:(PIHomeItemModel *)itmeModel{
_itemModel = itmeModel;
if (self.rankAvatarsModelArray.count > 0) {
_bgImageView.image = [UIImage imageNamed:@"home_rank_Heads_bg"];
} else {
_bgImageView.layer.cornerRadius = kGetScaleWidth(12);
@kWeakify(self);
[_bgImageView loadImageWithUrl:_itemModel.icon completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
@kStrongify(self);
self.bgImageView.layer.cornerRadius = kGetScaleWidth(0);
}];
switch (itmeModel.resourceType) {
case HomeMenuResourceType_H5:
// if (self.rankAvatarsModelArray.count > 0) {
self.bgImageView.image = [UIImage imageNamed:@"home_rank_Heads_bg"];
// } else {
// {
// @kWeakify(self);
// [self.bgImageView loadImageWithUrl:itmeModel.icon
// completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
// @kStrongify(self);
// self.bgImageView.layer.cornerRadius = kGetScaleWidth(0);
// }];
// }
// }
break;
case HomeMenuResourceType_Room_Game:
default:
self.bgImageView.image = [UIImage getLanguageImage:@"entrance_activities"];
break;
}
}

View File

@@ -0,0 +1,18 @@
//
// EventCenterViewController.h
// YuMi
//
// Created by P on 2025/4/29.
//
#import "MvpViewController.h"
@class HomeBannerInfoModel;
NS_ASSUME_NONNULL_BEGIN
@interface EventCenterViewController : MvpViewController
@property (nonatomic,copy) NSArray<HomeBannerInfoModel *> *officialEventModels;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,377 @@
//
// EventCenterViewController.m
// YuMi
//
// Created by P on 2025/4/29.
//
#import "EventCenterViewController.h"
#import "EventCenterPresenter.h"
#import "EventCenterEventCell.h"
#import "EventCenterOfficialCell.h"
@interface EventCenterViewController () <UIPageViewControllerDataSource, UIPageViewControllerDelegate, UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) NSMutableArray *officialDatasource;
@property (nonatomic, strong) NSMutableArray *eventSquareDatasource;
@property (nonatomic, strong) NSMutableArray *myEventDatasource;
@property (nonatomic, strong) UITableView *officialTableView;
@property (nonatomic, strong) UITableView *myEventTableView;
@property (nonatomic, strong) UITableView *eventSquareTableView;
@property (nonatomic, strong) UIView *tabView;
@property (nonatomic, strong) UIImageView *indicatorImageView;
@property (nonatomic, strong) NSArray<UIButton *> *tabButtons;
@property (nonatomic, strong) UIPageViewController *pageViewController;
@property (nonatomic, strong) NSArray<UIViewController *> *contentViewControllers;
@property (nonatomic, assign) NSInteger currentIndex;
@property (nonatomic, strong) UIButton *createButton;
- (void)switchToIndex:(NSInteger)index animated:(BOOL)animated;
@end
@implementation EventCenterViewController
- (__kindof id)presenter {
return [[EventCenterPresenter alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.title = YMLocalizedString(@"20.20.59_text_1");
[self setupTabView];
[self setupPageViewController];
[self setupBottomButton];
// createButton
self.createButton.hidden = (self.currentIndex == 0);
}
#pragma mark - Setup UI
- (void)setupTabView {
self.tabView = [[UIView alloc] init];
[self.view addSubview:self.tabView];
[self.tabView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop);
make.left.right.equalTo(self.view);
make.height.mas_equalTo(44);
}];
NSArray *titles = @[YMLocalizedString(@"20.20.59_text_2"), YMLocalizedString(@"20.20.59_text_3"), YMLocalizedString(@"20.20.59_text_4")];
NSMutableArray *buttons = [NSMutableArray array];
CGFloat buttonWidth = UIScreen.mainScreen.bounds.size.width / titles.count;
for (NSInteger i = 0; i < titles.count; i++) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setTitle:titles[i] forState:UIControlStateNormal];
[button setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
[button setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
button.tag = i;
[button addTarget:self action:@selector(tabButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.tabView addSubview:button];
[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.equalTo(self.tabView);
make.left.equalTo(self.tabView).offset(i * buttonWidth);
make.width.mas_equalTo(buttonWidth);
}];
[buttons addObject:button];
}
self.tabButtons = buttons;
//
self.indicatorImageView = [[UIImageView alloc] initWithImage:kImage(@"yellow_indicator")];
[self.tabView addSubview:self.indicatorImageView];
[self.indicatorImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.tabView);
make.width.mas_equalTo(21);
make.height.mas_equalTo(6);
make.centerX.equalTo(buttons.firstObject);
}];
//
self.currentIndex = 0;
((UIButton *)buttons.firstObject).selected = YES;
}
- (void)setupPageViewController {
//
NSMutableArray *viewControllers = [NSMutableArray array];
// 使TableView
UIViewController *officialVC = [[UIViewController alloc] init];
officialVC.view = self.officialTableView;
[viewControllers addObject:officialVC];
UIViewController *eventSquareVC = [[UIViewController alloc] init];
eventSquareVC.view = self.eventSquareTableView;
[viewControllers addObject:eventSquareVC];
UIViewController *myEventVC = [[UIViewController alloc] init];
myEventVC.view = self.myEventTableView;
[viewControllers addObject:myEventVC];
self.contentViewControllers = viewControllers;
// PageViewController
self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll
navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal
options:nil];
self.pageViewController.delegate = self;
self.pageViewController.dataSource = self;
[self addChildViewController:self.pageViewController];
[self.view addSubview:self.pageViewController.view];
[self.pageViewController didMoveToParentViewController:self];
[self.pageViewController.view mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.tabView.mas_bottom);
make.left.right.bottom.equalTo(self.view);
}];
//
[self.pageViewController setViewControllers:@[viewControllers.firstObject]
direction:UIPageViewControllerNavigationDirectionForward
animated:NO
completion:nil];
}
- (void)setupBottomButton {
[self.view addSubview:self.createButton];
[self.createButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.view).offset(-48);
make.size.mas_equalTo(CGSizeMake(195, 40));
}];
}
#pragma mark - Setup Data
- (void)setOfficialEventModels:(NSArray<HomeBannerInfoModel *> *)officialEventModels {
_officialDatasource = officialEventModels.mutableCopy;
[self.officialTableView reloadData];
}
#pragma mark - Actions
- (void)tabButtonClicked:(UIButton *)sender {
[self switchToIndex:sender.tag animated:YES];
}
- (void)switchToIndex:(NSInteger)index animated:(BOOL)animated {
if (index == self.currentIndex) return;
//
self.tabButtons[self.currentIndex].selected = NO;
self.tabButtons[index].selected = YES;
//
[self.indicatorImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.tabView);
make.width.mas_equalTo(21);
make.height.mas_equalTo(6);
make.centerX.equalTo(self.tabButtons[index]);
}];
if (animated) {
[UIView animateWithDuration:0.05 animations:^{
[self.view layoutIfNeeded];
}];
}
//
UIPageViewControllerNavigationDirection direction = index > self.currentIndex ? UIPageViewControllerNavigationDirectionForward : UIPageViewControllerNavigationDirectionReverse;
[self.pageViewController setViewControllers:@[self.contentViewControllers[index]]
direction:direction
animated:animated
completion:nil];
self.currentIndex = index;
// tabcreateButton
self.createButton.hidden = (index == 0);
}
- (void)didTapCreateButton {
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (tableView == self.officialTableView) {
return self.officialDatasource.count > 0 ? self.officialDatasource.count : 0;
} else if (tableView == self.eventSquareTableView) {
return self.eventSquareDatasource.count > 0 ? self.eventSquareDatasource.count : 0;
} else {
return self.myEventDatasource.count > 0 ? self.myEventDatasource.count : 0;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == self.officialTableView) {
EventCenterOfficialCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([EventCenterOfficialCell class])];
if (!cell) {
cell = [[EventCenterOfficialCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([EventCenterOfficialCell class])];
}
// cell
cell.cellModel = [self.officialDatasource xpSafeObjectAtIndex:indexPath.row];
return cell;
} else {
EventCenterEventCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([EventCenterEventCell class])];
if (!cell) {
cell = [[EventCenterEventCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([EventCenterEventCell class])];
}
// 广cell
if ((tableView == self.eventSquareTableView && self.eventSquareDatasource.count > indexPath.row) ||
(tableView == self.myEventTableView && self.myEventDatasource.count > indexPath.row)) {
// cell.model = tableView == self.eventSquareTableView ? self.eventSquareDatasource[indexPath.row] : self.myEventDatasource[indexPath.row];
}
return cell;
}
}
#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 150;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
// cell
if (tableView == self.officialTableView && self.officialDatasource.count > indexPath.row) {
//
} else if (tableView == self.eventSquareTableView && self.eventSquareDatasource.count > indexPath.row) {
// 广
} else if (tableView == self.myEventTableView && self.myEventDatasource.count > indexPath.row) {
//
}
}
#pragma mark - UIPageViewControllerDataSource
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController {
NSInteger index = [self.contentViewControllers indexOfObject:viewController];
if (index == 0 || index == NSNotFound) return nil;
return self.contentViewControllers[index - 1];
}
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController {
NSInteger index = [self.contentViewControllers indexOfObject:viewController];
if (index == self.contentViewControllers.count - 1 || index == NSNotFound) return nil;
return self.contentViewControllers[index + 1];
}
#pragma mark - UIPageViewControllerDelegate
- (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray<UIViewController *> *)previousViewControllers transitionCompleted:(BOOL)completed {
if (!completed) return;
NSInteger index = [self.contentViewControllers indexOfObject:pageViewController.viewControllers.firstObject];
if (index != NSNotFound) {
[self switchToIndex:index animated:YES];
}
}
#pragma mark - Lazy Loading
- (UITableView *)officialTableView {
if (!_officialTableView) {
_officialTableView = [[UITableView alloc] init];
_officialTableView.backgroundColor = [UIColor whiteColor];
_officialTableView.delegate = self;
_officialTableView.dataSource = self;
_officialTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
if (@available(iOS 11.0, *)) {
_officialTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
[_officialTableView registerClass:[EventCenterOfficialCell class] forCellReuseIdentifier:NSStringFromClass([EventCenterOfficialCell class])];
_officialTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
//
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.officialTableView.mj_header endRefreshing];
});
}];
_officialTableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
//
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.officialTableView.mj_footer endRefreshing];
});
}];
}
return _officialTableView;
}
- (UITableView *)eventSquareTableView {
if (!_eventSquareTableView) {
_eventSquareTableView = [[UITableView alloc] init];
_eventSquareTableView.backgroundColor = [UIColor whiteColor];
_eventSquareTableView.delegate = self;
_eventSquareTableView.dataSource = self;
_eventSquareTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
if (@available(iOS 11.0, *)) {
_eventSquareTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
[_eventSquareTableView registerClass:[EventCenterEventCell class] forCellReuseIdentifier:NSStringFromClass([EventCenterEventCell class])];
_eventSquareTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
//
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.eventSquareTableView.mj_header endRefreshing];
});
}];
_eventSquareTableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
//
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.eventSquareTableView.mj_footer endRefreshing];
});
}];
}
return _eventSquareTableView;
}
- (UITableView *)myEventTableView {
if (!_myEventTableView) {
_myEventTableView = [[UITableView alloc] init];
_myEventTableView.backgroundColor = [UIColor whiteColor];
_myEventTableView.delegate = self;
_myEventTableView.dataSource = self;
_myEventTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
if (@available(iOS 11.0, *)) {
_myEventTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
[_myEventTableView registerClass:[EventCenterEventCell class] forCellReuseIdentifier:NSStringFromClass([EventCenterEventCell class])];
_myEventTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
//
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.myEventTableView.mj_header endRefreshing];
});
}];
_myEventTableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
//
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.myEventTableView.mj_footer endRefreshing];
});
}];
}
return _myEventTableView;
}
- (UIButton *)createButton {
if (!_createButton) {
_createButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_createButton setTitle:YMLocalizedString(@"20.20.59_text_8") forState:UIControlStateNormal];
[_createButton addGradientBackgroundWithColors:@[
UIColorFromRGB(0xe29030),
UIColorFromRGB(0xfcc074)
] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(1, 0.5) cornerRadius:20];
[_createButton setCornerRadius:20];
[_createButton addTarget:self action:@selector(didTapCreateButton) forControlEvents:UIControlEventTouchUpInside];
}
return _createButton;
}
@end

View File

@@ -55,6 +55,7 @@
#import "PIHomeCategoryTitleModel.h"
#import "RegionListViewController.h"
#import "EventCenterViewController.h"
UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
UIKIT_EXTERN NSString * const kOpenRoomNotification;
@@ -783,35 +784,44 @@ XPHomeRecommendOtherRoomViewDelegate>
}
///
-(void)selectItemWithModel:(PIHomeItemModel *)model{
if (model.resourceType == HomeMenuResourceType_H5) {
XPWebViewController * webVC = [[ XPWebViewController alloc] initWithRoomUID:nil];
webVC.url = model.resourceContent;
[self.navigationController pushViewController:webVC animated:YES];
}else if (model.resourceType == HomeMenuResourceType_Match) { //
[self.presenter homeChatPick];
}else {
NSString * uid = [AccountInfoStorage instance].getUid;
if (model.ID.length > 0 && uid.length > 0) {
@kWeakify(self);
[Api homePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
if (code == 200) {
HomeMenuSourceModel * sourceModel = [HomeMenuSourceModel modelWithDictionary:data.data];
if (sourceModel.isPick) {
if (sourceModel.uid.integerValue > 0) {
[XPRoomViewController openRoom:sourceModel.uid fromNick:nil fromType:UserEnterRoomFromType_Home_Recommend fromUid:nil viewController:self];
}
} else {
XPHomeRecommendOtherRoomView * recommendView = [[XPHomeRecommendOtherRoomView alloc] init];
recommendView.delegate = self;
recommendView.roomInfo = sourceModel;
[TTPopup popupView:recommendView style:TTPopupStyleAlert];
}
} else {
[XNDJTDDLoadingTool showErrorWithMessage:msg];
}
} uid:uid rid:model.ID];
switch (model.resourceType) {
case HomeMenuResourceType_H5: {
XPWebViewController * webVC = [[ XPWebViewController alloc] initWithRoomUID:nil];
webVC.url = model.resourceContent;
[self.navigationController pushViewController:webVC animated:YES];
}
break;
case HomeMenuResourceType_Match:
[self.presenter homeChatPick];
break;
case HomeMenuResourceType_Room_Game: {
// @kWeakify(self);
// [Api homePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
// @kStrongify(self);
// if (code == 200) {
// HomeMenuSourceModel * sourceModel = [HomeMenuSourceModel modelWithDictionary:data.data];
// if (sourceModel.isPick) {
// if (sourceModel.uid.integerValue > 0) {
// [XPRoomViewController openRoom:sourceModel.uid fromNick:nil fromType:UserEnterRoomFromType_Home_Recommend fromUid:nil viewController:self];
// }
// } else {
// XPHomeRecommendOtherRoomView * recommendView = [[XPHomeRecommendOtherRoomView alloc] init];
// recommendView.delegate = self;
// recommendView.roomInfo = sourceModel;
// [TTPopup popupView:recommendView style:TTPopupStyleAlert];
// }
// } else {
// [XNDJTDDLoadingTool showErrorWithMessage:msg];
// }
// } uid:uid rid:model.ID];
}
default:
{
EventCenterViewController *vc = [[EventCenterViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
vc.officialEventModels = self.headView.bannerList;
}
break;
}
}
-(void)selectBannerListWithModel:(HomeBannerInfoModel *)model{

View File

@@ -1028,10 +1028,13 @@ XPRoomGraffitiGiftAnimationViewDelegate
}
}
if (self.giftEffectTimer == nil &&
self.svgaQueue.count > 0) {
[self startHandleGiftEffectTimer];
}
dispatch_async(self.giftEffectsQueue, ^{
if (self.giftEffectTimer == nil &&
self.svgaQueue.count > 0) {
[self startHandleGiftEffectTimer];
}
});
}
- (void)handleLuckyBagGifts:(GiftReceiveInfoModel *)receiveInfo {
@@ -1081,7 +1084,7 @@ XPRoomGraffitiGiftAnimationViewDelegate
return;
}
dispatch_async(self.giftEffectsQueue, ^{
// NSLog(@"******************* 当前队列个数: %@image loader 个数: %@", @(self.svgaQueue.count), @(self.mp4AvatarLoaders.count));
NSLog(@"******************* 当前队列个数: %@image loader 个数: %@", @(self.svgaQueue.count), @(self.mp4AvatarLoaders.count));
if (self.svgaQueue.count == 0) {
dispatch_source_cancel(timer);
dispatch_async(dispatch_get_main_queue(), ^{
@@ -1689,8 +1692,9 @@ XPRoomGraffitiGiftAnimationViewDelegate
model.uid = receiveInfo.uid.integerValue;
receiveInfo.targetUsers = @[model];
}
if (receiveInfo.targetUids.count == 0 && attachment.second == Custom_Message_Sub_Gift_Send) {
receiveInfo.targetUids = @[@(receiveInfo.uid.integerValue)];
// uid
if (receiveInfo.targetUsers.count > 0 && receiveInfo.targetUids.count <= 0) {
receiveInfo.targetUids = [receiveInfo.targetUsers valueForKeyPath:@"uid"];
}
}

View File

@@ -28,13 +28,11 @@
#import "XPRoomFacePresenter.h"
#import "XPRoomFaceProtocol.h"
@interface XPRoomFaceViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout, XPRoomFaceProtocol>
@interface XPRoomFaceViewController ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout, XPRoomFaceProtocol, UIGestureRecognizerDelegate>
///View
@property (nonatomic,strong) UIView * topView;
///
@property (nonatomic,strong) UIView * contentView;
///
@property (nonatomic,strong) UIVisualEffectView *effectView;
///
@property (nonatomic,strong) UIStackView *stackView;
///
@@ -232,6 +230,10 @@
return resultArray;
}
#pragma mark - Gesture Delegate
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
}
#pragma mark - scrollviewdelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
@@ -335,9 +337,6 @@
#pragma mark - Event Response
- (void)noblePrivilButtonAction:(UIButton *)sender {
[self dismissViewControllerAnimated:YES completion:nil];
return;
// XPNobleCenterViewController * nobleCenter = [[XPNobleCenterViewController alloc] init];
// [((UINavigationController *)self.presentingViewController) pushViewController:nobleCenter animated:YES];
}
- (void)disMissViewRecognizer {
@@ -348,9 +347,11 @@
- (UIView *)topView {
if (!_topView) {
_topView = [[UIView alloc] init];
_topView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3];
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissViewRecognizer)];
[_topView addGestureRecognizer:tap];
_topView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.2];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissViewRecognizer)];
tap.cancelsTouchesInView = NO;
tap.delegate = self;
[_topView addGestureRecognizer:tap];
}
return _topView;
}
@@ -363,15 +364,6 @@
return _contentView;
}
- (UIVisualEffectView *)effectView {
if (!_effectView) {
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
_effectView = [[UIVisualEffectView alloc]initWithEffect:effect];
_effectView.alpha = 1;
}
return _effectView;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];

View File

@@ -391,6 +391,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
}];
[self.stackView addArrangedSubview:self.inputButton];
// [self.stackView addArrangedSubview:self.faceButton];
[self.stackView addArrangedSubview:self.micButton];
[self.stackView addArrangedSubview:self.voiceButton];
[self.stackView addArrangedSubview:self.arrangeMicButton];
@@ -398,7 +399,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
[self.stackView addArrangedSubview:self.moreButton];
[self.stackView addArrangedSubview:self.giftButton];
[self.stackView addSubview:self.faceButton];
[self.stackView addSubview:self.faceButton];
[self.stackView addSubview:self.micButton_open];
[self.stackView addSubview:self.micButton_close_all];
@@ -433,9 +434,9 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
}];
[self.faceButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.inputButton);
make.trailing.mas_equalTo(self.inputButton).offset(-7);
make.width.height.mas_equalTo(22);
make.centerY.mas_equalTo(self.inputButton);
make.trailing.mas_equalTo(self.inputButton).offset(-4);
make.width.height.mas_equalTo(36);
}];
[self.micButton mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -560,8 +560,10 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
if (!_topView) {
_topView = [[UIView alloc] init];
_topView.backgroundColor = [UIColor clearColor];
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissRecognizer)];
[_topView addGestureRecognizer:tap];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(disMissRecognizer)];
tap.cancelsTouchesInView = NO;
tap.delegate = self;
[_topView addGestureRecognizer:tap];
}
return _topView;
}

View File

@@ -29,7 +29,7 @@
// GiftReceiveInfoModel NSDictionary
@property (nonatomic, strong) NSMutableArray *giftComboQueue;
@property (nonatomic, strong) NSMutableArray *comboFlagQueue;
@property (nonatomic, strong) NSTimer *comboFlagTimer;
@property (nonatomic, strong) dispatch_source_t comboFlagTimer;
@property (nonatomic, strong) UIView *containerView;
//
@@ -60,6 +60,13 @@
#pragma mark -
- (void)dealloc {
[self stopProcessingGiftComboFlagQueue];
if (self.comboFlagQueue) {
self.comboFlagQueue = NULL;
}
}
+ (instancetype)sharedManager {
static GiftComboManager *sharedInstance = nil;
static dispatch_once_t onceToken;
@@ -166,12 +173,38 @@
}
- (void)startProcessingGiftComboFlagQueue {
self.comboFlagTimer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(processGiftFlagQueue) userInfo:nil repeats:YES];
if (self.comboFlagTimer) {
return;
}
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
dispatch_source_set_timer(timer,
DISPATCH_TIME_NOW,
0.2 * NSEC_PER_SEC,
0.01 * NSEC_PER_SEC);
@kWeakify(self);
dispatch_source_set_event_handler(timer, ^{
@kStrongify(self);
[self processGiftFlagQueue];
});
dispatch_resume(timer);
self.comboFlagTimer = timer;
}
- (void)stopProcessingGiftComboFlagQueue {
[self.comboFlagTimer invalidate];
self.comboFlagTimer = nil;
if (self.comboFlagTimer) {
dispatch_source_cancel(self.comboFlagTimer);
@kWeakify(self);
dispatch_source_set_cancel_handler(self.comboFlagTimer, ^{
@kStrongify(self);
self.comboFlagTimer = nil;
});
}
}
- (void)processGiftFlagQueue {
@@ -181,7 +214,9 @@
GiftReceiveInfoModel *receiveInfo = [self.giftComboQueue firstObject];
[self.giftComboQueue removeObjectAtIndex:0];
[self handleGiftInfo:receiveInfo];
dispatch_async(dispatch_get_main_queue(), ^{
[self handleGiftInfo:receiveInfo];
});
}
- (void)handleGiftInfo:(GiftReceiveInfoModel *)receiveInfo {
@@ -285,7 +320,7 @@
}
// MARK: Logic is 0.2s
// MARK: Logic is 0.25s
#pragma mark -
//
@@ -298,7 +333,7 @@
self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue());
// 0.3
dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC, 0.01 * NSEC_PER_SEC);
dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 0.25 * NSEC_PER_SEC, 0.01 * NSEC_PER_SEC);
//
dispatch_source_set_event_handler(self.timer, ^{
@@ -360,9 +395,11 @@
@synchronized (self) {
if (self.requestQueue.count > 0) {
//
NSDictionary *dic = [self.requestQueue firstObject];
[self handleSendGift:dic];
[self.requestQueue removeObject:dic];
NSDictionary *dic = [self.requestQueue xpSafeObjectAtIndex:0];
if (dic) {
[self handleSendGift:dic];
[self.requestQueue removeObject:dic];
}
} else {
[self stopProcessingQueue];
}

View File

@@ -210,28 +210,24 @@
- (void)handleTap {
static BOOL isHandlingTap = NO;
if (isHandlingTap) {
// NSLog(@"点击间隔过短,忽略此次点击");
return;
}
isHandlingTap = YES;
[self.feedbackGenerator impactOccurred];
[[GiftComboManager sharedManager] sendGift];
[self.playImageView startAnimation];
[self.countdownRingView resetCountdown];
//
// NSLog(@"有效点击处理");
@kWeakify(self);
//
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
@kStrongify(self);
// 1521 3
// AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
// AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate));
[self.feedbackGenerator impactOccurred];
[[GiftComboManager sharedManager] sendGift];
[self.playImageView startAnimation];
[self.countdownRingView resetCountdown];
isHandlingTap = NO;
});
}

View File

@@ -80,7 +80,11 @@
point = CGPointMake(paddingH + (mcWidth + marginH) * (index - 10) + mcWidth / 2, tRowTop + mcHeight / 2);
}
point = [self convertPoint:point toView:nil];
if (CGPointEqualToPoint(point, CGPointZero)) {
point = CGPointMake(KScreenWidth/2, 70);
} else {
point = [self convertPoint:point toView:nil];
}
return point;
}
@@ -99,7 +103,11 @@
point = CGPointMake(paddingH + (mcWidth + marginH) * (index - 10) + mcWidth / 2, tRowTop + mcHeight / 2);
}
point = [self convertPoint:point toView:nil];
if (CGPointEqualToPoint(point, CGPointZero)) {
point = CGPointMake(KScreenWidth/2, 70);
} else {
point = [self convertPoint:point toView:nil];
}
return point;
}

View File

@@ -120,7 +120,7 @@ static const NSInteger kMicCountPerRow = 5;
- (CGPoint)animationPointAtStageViewByIndex:(NSInteger)index {
if (index < 0 || index >= [self countOfMicroView]) {
return CGPointZero;
return CGPointMake(KScreenWidth/2, 70);
}
CGRect rect = [self rectForViewAtIndex:index];

View File

@@ -103,7 +103,13 @@
if (index >= 5 && index <= 9) {
point = CGPointMake(paddingH + (mcWidth + marginH) * (index - 4 - 1) + mcWidth / 2, s_top + mcWidth / 2 - 10);
}
point = [self convertPoint:point toView:nil];
if (CGPointEqualToPoint(point, CGPointZero)) {
point = CGPointMake(KScreenWidth/2, 70);
} else {
point = [self convertPoint:point toView:nil];
}
return point;
}

View File

@@ -71,7 +71,11 @@
if (index >= 5 && index < 10) {
point = CGPointMake(paddingH + (mcWidth + marginH) * (index - 5) + mcWidth / 2, sRowTop + mcWidth / 2);
}
point = [self convertPoint:point toView:nil];
if (CGPointEqualToPoint(point, CGPointZero)) {
point = CGPointMake(KScreenWidth/2, 70);
} else {
point = [self convertPoint:point toView:nil];
}
return point;
}

View File

@@ -67,7 +67,7 @@ static const NSInteger kMicCountPerRow = 5;
- (CGPoint)animationPointAtStageViewByIndex:(NSInteger)index {
if (index < 0 || index >= [self countOfMicroView]) {
return CGPointMake(KScreenWidth/2 - mcWidth/2, mcHeight);
return CGPointMake(KScreenWidth/2, 50);
}
CGPoint position = [self positionForIndex:index rowHeight:mcHeight];
return [self convertPoint:position toView:nil];

View File

@@ -1788,7 +1788,6 @@ XPCandyTreeInsufficientBalanceViewDelegate>
}
[XPRoomMiniManager shareManager].curState = nil;
}
}
- (void)getRoomFirstChargeWindowSuccess:(FirstChargeRoomWindowModel *)model{
if(model.needToShow == NO || model.showAfterSecond <= 0 || self.isShowFirstRecharge == YES)return;
@@ -1854,7 +1853,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
continue;
}
// NSLog(@" --- Message Raw Attach Content: %@, %@, %ld", @(message.senderClientType), message.rawAttachContent, (long)message.messageType);
NSLog(@" --- Message Raw Attach Content: %@, %@, %ld", @(message.senderClientType), message.rawAttachContent, (long)message.messageType);
if (message.messageType == NIMMessageTypeNotification) {
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;

View File

@@ -237,7 +237,6 @@
NSLog(@"\n%@", [baseModel toJSONString]);
#else
#endif
success(baseModel);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[self handleNetError:error method:method failure:failure];

View File

@@ -4169,3 +4169,12 @@ ineHeadView12" = "الحمل";
"20.20.56_text_18" = "مقبول";
"20.20.56_text_19" = "مرفوض";
"20.20.56_text_20" = "والآخر يرفض دعوتك لتغيير العلاقات.";
"20.20.59_text_1" = "老年人活動中心";
"20.20.59_text_2" = "Offical";
"20.20.59_text_3" = "Event Square";
"20.20.59_text_4" = "My Events";
"20.20.59_text_5" = "Sub";
"20.20.59_text_6" = "Unsub";
"20.20.59_text_7" = "Participate";
"20.20.59_text_8" = "Create Event";

View File

@@ -3954,3 +3954,12 @@
"20.20.56_text_18" = "Accepted";
"20.20.56_text_19" = "Rejected";
"20.20.56_text_20" = "The other rejects your invitation to change relationships.";
"20.20.59_text_1" = "老年人活動中心";
"20.20.59_text_2" = "Offical";
"20.20.59_text_3" = "Event Square";
"20.20.59_text_4" = "My Events";
"20.20.59_text_5" = "Sub";
"20.20.59_text_6" = "Unsub";
"20.20.59_text_7" = "Participate";
"20.20.59_text_8" = "Create Event";

View File

@@ -3747,3 +3747,12 @@
"20.20.56_text_18" = "Kabul Edildi";
"20.20.56_text_19" = "Reddedildi";
"20.20.56_text_20" = "Diğeri sizin ilişkileri değiştirme davetinizi reddeder.";
"20.20.59_text_1" = "老年人活動中心";
"20.20.59_text_2" = "Offical";
"20.20.59_text_3" = "Event Square";
"20.20.59_text_4" = "My Events";
"20.20.59_text_5" = "Sub";
"20.20.59_text_6" = "Unsub";
"20.20.59_text_7" = "Participate";
"20.20.59_text_8" = "Create Event";

View File

@@ -3619,3 +3619,12 @@
"20.20.56_text_18" = "已接受";
"20.20.56_text_19" = "已拒絕";
"20.20.56_text_20" = "拒绝改变关系的邀请。";
"20.20.59_text_1" = "老年人活動中心";
"20.20.59_text_2" = "Offical";
"20.20.59_text_3" = "Event Square";
"20.20.59_text_4" = "My Events";
"20.20.59_text_5" = "Sub";
"20.20.59_text_6" = "Unsub";
"20.20.59_text_7" = "Participate";
"20.20.59_text_8" = "Create Event";