红包UI
This commit is contained in:
@@ -290,6 +290,7 @@
|
||||
238B37DC2AC55A2C00BFC9D5 /* XPTreasureFairyBallView.m in Sources */ = {isa = PBXBuildFile; fileRef = 238B37942AC55A2C00BFC9D5 /* XPTreasureFairyBallView.m */; };
|
||||
238B37DD2AC55A2C00BFC9D5 /* XPTreasureFairyStoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = 238B379A2AC55A2C00BFC9D5 /* XPTreasureFairyStoreView.m */; };
|
||||
238B37DE2AC55A2C00BFC9D5 /* Api+TreasureFairy.m in Sources */ = {isa = PBXBuildFile; fileRef = 238B37A12AC55A2C00BFC9D5 /* Api+TreasureFairy.m */; };
|
||||
238ED83A2AE2891D0014EF9D /* PIRoomEnterRedPacketView.m in Sources */ = {isa = PBXBuildFile; fileRef = 238ED8392AE2891D0014EF9D /* PIRoomEnterRedPacketView.m */; };
|
||||
239141C62AE129F700322CA9 /* PIInputScrollingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 239141C52AE129F700322CA9 /* PIInputScrollingView.m */; };
|
||||
239141C92AE1358F00322CA9 /* PIInputEntireServerScrollingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 239141C82AE1358F00322CA9 /* PIInputEntireServerScrollingView.m */; };
|
||||
239141CC2AE267EF00322CA9 /* PIReceiveRedPacketSuccessView.m in Sources */ = {isa = PBXBuildFile; fileRef = 239141CB2AE267EF00322CA9 /* PIReceiveRedPacketSuccessView.m */; };
|
||||
@@ -2006,6 +2007,8 @@
|
||||
238B379F2AC55A2C00BFC9D5 /* XPTreasureFairyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPTreasureFairyViewController.h; sourceTree = "<group>"; };
|
||||
238B37A12AC55A2C00BFC9D5 /* Api+TreasureFairy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Api+TreasureFairy.m"; sourceTree = "<group>"; };
|
||||
238B37A22AC55A2C00BFC9D5 /* Api+TreasureFairy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Api+TreasureFairy.h"; sourceTree = "<group>"; };
|
||||
238ED8382AE2891D0014EF9D /* PIRoomEnterRedPacketView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomEnterRedPacketView.h; sourceTree = "<group>"; };
|
||||
238ED8392AE2891D0014EF9D /* PIRoomEnterRedPacketView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomEnterRedPacketView.m; sourceTree = "<group>"; };
|
||||
239141C42AE129F700322CA9 /* PIInputScrollingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIInputScrollingView.h; sourceTree = "<group>"; };
|
||||
239141C52AE129F700322CA9 /* PIInputScrollingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIInputScrollingView.m; sourceTree = "<group>"; };
|
||||
239141C72AE1358F00322CA9 /* PIInputEntireServerScrollingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIInputEntireServerScrollingView.h; sourceTree = "<group>"; };
|
||||
@@ -5989,6 +5992,8 @@
|
||||
9BA812D528BF52E100783EA7 /* XPRoomSendRedPacketViewController.m */,
|
||||
23D321E32ADFE900006B259C /* PIRoomSendRedPacketVC.h */,
|
||||
23D321E42ADFE900006B259C /* PIRoomSendRedPacketVC.m */,
|
||||
238ED8382AE2891D0014EF9D /* PIRoomEnterRedPacketView.h */,
|
||||
238ED8392AE2891D0014EF9D /* PIRoomEnterRedPacketView.m */,
|
||||
23D321E62ADFED0F006B259C /* PIRoomSendRedPacketItemVC.h */,
|
||||
23D321E72ADFED0F006B259C /* PIRoomSendRedPacketItemVC.m */,
|
||||
9BA812E228BF70A600783EA7 /* XPRoomRedPacketPwdView.h */,
|
||||
@@ -10767,6 +10772,7 @@
|
||||
238B37C72AC55A2C00BFC9D5 /* XPTreasureFairyPrizeRecordView.m in Sources */,
|
||||
E8B9843628ABA8B40022D026 /* XPMonentPublishSuccessView.m in Sources */,
|
||||
E87DF4E02A42CA92009C1185 /* XPHomeSloganViewController.m in Sources */,
|
||||
238ED83A2AE2891D0014EF9D /* PIRoomEnterRedPacketView.m in Sources */,
|
||||
23E9E9972A80C3A100B792F2 /* XPMineGuildPersonalBillRecordVC.m in Sources */,
|
||||
E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */,
|
||||
18EE3FF42750FA3700A452BF /* UIView+NIM.m in Sources */,
|
||||
|
22
YuMi/Assets.xcassets/yna/RedPacket/pi_red_packet_enter_bg.imageset/Contents.json
vendored
Normal file
22
YuMi/Assets.xcassets/yna/RedPacket/pi_red_packet_enter_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "pi_red_packet_enter_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "pi_red_packet_enter_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/yna/RedPacket/pi_red_packet_enter_bg.imageset/pi_red_packet_enter_bg@2x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/yna/RedPacket/pi_red_packet_enter_bg.imageset/pi_red_packet_enter_bg@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
BIN
YuMi/Assets.xcassets/yna/RedPacket/pi_red_packet_enter_bg.imageset/pi_red_packet_enter_bg@3x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/yna/RedPacket/pi_red_packet_enter_bg.imageset/pi_red_packet_enter_bg@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
22
YuMi/Assets.xcassets/yna/RedPacket/pi_red_packet_enter_rob_icon.imageset/Contents.json
vendored
Normal file
22
YuMi/Assets.xcassets/yna/RedPacket/pi_red_packet_enter_rob_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "pi_red_packet_enter_rob_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "pi_red_packet_enter_rob_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 515 B |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@@ -34,22 +34,21 @@
|
||||
#import "XPSailingViewController.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "XPTreasureFairyViewController.h"
|
||||
#import "PIRoomEnterRedPacketView.h"
|
||||
UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate>
|
||||
///容器
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
///轮播图
|
||||
@property (nonatomic,strong) SDCycleScrollView *pi_cycleScrollView;
|
||||
///
|
||||
@property (nonatomic,strong) UIView * placeHolderView;
|
||||
|
||||
///糖果树
|
||||
@property (nonatomic,strong) NetImageView *lookLoveImageView;
|
||||
|
||||
|
||||
///红包
|
||||
@property(nonatomic,strong) PIRoomEnterRedPacketView *redPacketView;
|
||||
///夺宝精灵
|
||||
@property (nonatomic,strong) TreasureFairyLimitModel *fairyModel;
|
||||
///首充的
|
||||
@property (nonatomic,strong) UIImageView *firstRechargeImageView;
|
||||
///参加相亲
|
||||
@property (nonatomic,strong) UIImageView *joinDatingView;
|
||||
///host 代理
|
||||
@@ -86,9 +85,10 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.stackView];
|
||||
UIView *emptyView = [UIView new];
|
||||
[self.stackView addArrangedSubview:self.pi_cycleScrollView];
|
||||
[self.stackView addArrangedSubview:self.placeHolderView];
|
||||
[self.stackView addArrangedSubview:self.firstRechargeImageView];
|
||||
[self.stackView addArrangedSubview:emptyView];
|
||||
[self.stackView addArrangedSubview:self.redPacketView];
|
||||
[self.stackView addArrangedSubview:self.lookLoveImageView];
|
||||
[self.stackView addArrangedSubview:self.joinDatingView];
|
||||
}
|
||||
@@ -102,11 +102,11 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
[self.pi_cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemWidth , itemWidth));
|
||||
}];
|
||||
|
||||
[self.firstRechargeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth));
|
||||
[self.redPacketView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(58));
|
||||
}];
|
||||
|
||||
|
||||
[self.lookLoveImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemWidth, itemWidth));
|
||||
}];
|
||||
@@ -243,7 +243,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
- (void)onRoomUpdate {
|
||||
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
|
||||
if (roomInfo.type == RoomType_MiniGame) {
|
||||
self.firstRechargeImageView.hidden = YES;
|
||||
|
||||
self.lookLoveImageView.hidden = YES;
|
||||
self.sailingImageView.hidden = YES;
|
||||
if (self.isLoadActivity) {
|
||||
@@ -256,7 +256,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
[self.activityList removeObject:self.lookLoveModel];
|
||||
}
|
||||
[self configLookLove];
|
||||
self.firstRechargeImageView.hidden = YES;
|
||||
|
||||
[self configFairy];
|
||||
[self configfirstRecharge];
|
||||
NSMutableArray *picArray = [NSMutableArray array];
|
||||
@@ -464,15 +464,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
return _pi_cycleScrollView;
|
||||
}
|
||||
|
||||
- (UIView *)placeHolderView {
|
||||
if (!_placeHolderView) {
|
||||
_placeHolderView = [[UIView alloc] init];
|
||||
_placeHolderView.backgroundColor = [UIColor clearColor];
|
||||
[_placeHolderView setContentHuggingPriority:UILayoutPriorityDragThatCanResizeScene forAxis:UILayoutConstraintAxisHorizontal];
|
||||
[_placeHolderView setContentCompressionResistancePriority:UILayoutPriorityFittingSizeLevel forAxis:UILayoutConstraintAxisHorizontal];
|
||||
}
|
||||
return _placeHolderView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
@@ -501,16 +493,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
return _lookLoveImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)firstRechargeImageView {
|
||||
if (!_firstRechargeImageView) {
|
||||
_firstRechargeImageView = [[UIImageView alloc] init];
|
||||
_firstRechargeImageView.image = [UIImage imageNamed:@"room_first_recharge_enter"];
|
||||
_firstRechargeImageView.userInteractionEnabled = YES;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(firstRechargeTapRecognizer)];
|
||||
[_firstRechargeImageView addGestureRecognizer:tap];
|
||||
}
|
||||
return _firstRechargeImageView;
|
||||
}
|
||||
|
||||
|
||||
- (UIImageView *)joinDatingView {
|
||||
if (!_joinDatingView) {
|
||||
@@ -572,5 +555,10 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
}
|
||||
return _lookLoveModel;
|
||||
}
|
||||
|
||||
- (PIRoomEnterRedPacketView *)redPacketView{
|
||||
if(!_redPacketView){
|
||||
_redPacketView = [[PIRoomEnterRedPacketView alloc]initWithFrame:CGRectZero];
|
||||
}
|
||||
return _redPacketView;
|
||||
}
|
||||
@end
|
||||
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// PIRoomEnterRedPacketView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/10/20.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface PIRoomEnterRedPacketView : UIView
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// PIRoomEnterRedPacketView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/10/20.
|
||||
//
|
||||
|
||||
#import "PIRoomEnterRedPacketView.h"
|
||||
#import "CountDownHelper.h"
|
||||
@interface PIRoomEnterRedPacketView ()<CountDownHelperDelegate>
|
||||
@property(nonatomic,strong) UIImageView *bgImageView;
|
||||
@property(nonatomic,strong) UIButton *robBtn;
|
||||
///倒计时
|
||||
@property(nonatomic,strong) UILabel *countDownView;
|
||||
///倒计时
|
||||
@property (nonatomic,strong) CountDownHelper *countDownHelper;
|
||||
@end
|
||||
@implementation PIRoomEnterRedPacketView
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.bgImageView];
|
||||
[self.bgImageView addSubview:self.robBtn];
|
||||
[self.bgImageView addSubview:self.countDownView];
|
||||
}
|
||||
-(void)installConstraints{
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.robBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(kGetScaleWidth(36));
|
||||
make.height.mas_equalTo(kGetScaleWidth(15));
|
||||
make.bottom.mas_equalTo(-kGetScaleWidth(10));
|
||||
make.centerX.equalTo(self.bgImageView);
|
||||
}];
|
||||
[self.countDownView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.robBtn);
|
||||
}];
|
||||
}
|
||||
#pragma mark- CountDownHelperDelegate
|
||||
///倒计时结束
|
||||
- (void)onCountdownFinish{
|
||||
|
||||
}
|
||||
///倒计时进行
|
||||
- (void)onCountdownOpen:(int)time{
|
||||
NSInteger seconds = time;
|
||||
int minutes = (seconds)%3600/60;
|
||||
int second = (seconds)%60;
|
||||
self.countDownView.text = [NSString stringWithFormat:@"%02d:%02d",minutes,second];
|
||||
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (UIImageView *)bgImageView{
|
||||
if(!_bgImageView){
|
||||
_bgImageView = [UIImageView new];
|
||||
_bgImageView.image = kImage(@"pi_red_packet_enter_bg");
|
||||
_bgImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
-(UIButton *)robBtn{
|
||||
if(!_robBtn){
|
||||
_robBtn = [UIButton new];
|
||||
[_robBtn setBackgroundImage:kImage(@"pi_red_packet_enter_rob_icon") forState:UIControlStateNormal];
|
||||
[_robBtn setTitle:YMLocalizedString(@"PIRoomEnterRedPacketView0") forState:UIControlStateNormal];
|
||||
[_robBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_robBtn.titleLabel.font = kFontMedium(9);
|
||||
}
|
||||
return _robBtn;
|
||||
}
|
||||
- (UILabel *)countDownView{
|
||||
if(!_countDownView){
|
||||
_countDownView = [UILabel labelInitWithText:@"00:00" font:kFontSemibold(10) textColor:[UIColor whiteColor]];
|
||||
_countDownView.textAlignment = NSTextAlignmentCenter;
|
||||
_countDownView.layer.cornerRadius = kGetScaleWidth(15)/2;
|
||||
_countDownView.layer.masksToBounds = YES;
|
||||
_countDownView.backgroundColor = UIColorRGBAlpha(0x292929, 0.6);
|
||||
}
|
||||
return _countDownView;
|
||||
}
|
||||
- (CountDownHelper *)countDownHelper{
|
||||
if (!_countDownHelper){
|
||||
_countDownHelper = [[CountDownHelper alloc]init];
|
||||
_countDownHelper.delegate = self;
|
||||
}
|
||||
return _countDownHelper;
|
||||
}
|
||||
@end
|
@@ -74,6 +74,7 @@
|
||||
#import "LittleGameScrollStageView.h"
|
||||
#import "XPRoomLittleGameContainerView.h"
|
||||
|
||||
|
||||
UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
|
||||
UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
|
||||
@@ -107,6 +108,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
@property (nonatomic,strong) XPRoomFunctionContainerView *functionView;
|
||||
///小游戏的容器
|
||||
@property (nonatomic,strong) XPRoomLittleGameContainerView *littleGameView;
|
||||
|
||||
///房间的Uid
|
||||
@property (nonatomic,copy) NSString * roomUid;
|
||||
///小游戏的id
|
||||
@@ -419,6 +421,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5);
|
||||
make.width.mas_equalTo(80);
|
||||
}];
|
||||
|
||||
|
||||
[self.functionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.anchorScrollView.middleImageView);
|
||||
}];
|
||||
@@ -561,6 +565,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).offset(-5);
|
||||
make.width.mas_equalTo(80);
|
||||
}];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,6 +616,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
make.bottom.mas_equalTo(self.quickMessageContainerView.mas_top).mas_offset(-5);
|
||||
make.width.mas_equalTo(80);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - CountDownHelperDelegate
|
||||
|
@@ -3149,6 +3149,8 @@
|
||||
"PIInputScrollingView0"="输入指定弹幕内容(最多10个字符)";
|
||||
///PIInputEntireServerScrollingView
|
||||
"PIInputEntireServerScrollingView0"="恭喜发财,大吉大利!";
|
||||
///PIRoomEnterRedPacketView
|
||||
"PIRoomEnterRedPacketView0"="抢红包";
|
||||
///不能脚本生成的
|
||||
"App_Common_And" = "和";
|
||||
"App_Common_Male" = "男";
|
||||
|
@@ -3154,6 +3154,9 @@
|
||||
"PIInputScrollingView0"="輸入指定彈幕內容(最多10個字符)";
|
||||
///PIInputEntireServerScrollingView
|
||||
"PIInputEntireServerScrollingView0"="恭喜發財,大吉大利!";
|
||||
///PIRoomEnterRedPacketView
|
||||
"PIRoomEnterRedPacketView0"="搶紅包";
|
||||
|
||||
///不能腳本生成的
|
||||
"App_Common_And" = "和";
|
||||
"App_Common_Male" = "男";
|
||||
|
Reference in New Issue
Block a user