This commit is contained in:
启星
2025-09-23 09:13:16 +08:00
parent 048b9339eb
commit 0f6df9fb87
17 changed files with 188 additions and 25 deletions

View File

@@ -17,6 +17,13 @@ typedef NS_ENUM(NSInteger) {
/// 抽100次
QXMeetDrawBtnTypeHundred = 100,
}QXMeetDrawBtnType;
@protocol QXMeetActivityViewDelegate <NSObject>
@optional
-(void)timeDownDidFinished;
@end
@interface QXMeetActivityView : UIView
-(void)showInView:(UIView *)view;
@property (nonatomic,strong)NSString *roomId;
@@ -42,6 +49,8 @@ typedef NS_ENUM(NSInteger) {
@property (nonatomic,assign)long long startTime;
@property (nonatomic,strong)QXTimer *timer;
@property (nonatomic,weak)id<QXMeetActivityViewDelegate>delegate;
@end

View File

@@ -14,7 +14,7 @@
#import "QXMeetLotteryView.h"
#import "QXDiamondViewController.h"
@interface QXMeetActivityView()<UIGestureRecognizerDelegate,QXMeetLotteryViewDelegate>
@interface QXMeetActivityView()<UIGestureRecognizerDelegate,QXMeetLotteryViewDelegate,QXMeetActivityViewDelegate>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
///
@@ -146,6 +146,7 @@
[self.bgView addSubview:self.recordBtn];
self.timeDownView = [[QXMeetTimeDownView alloc] initWithFrame:CGRectMake((self.bgView.width-ScaleWidth(122))/2, self.rankBtn.top-4, ScaleWidth(122), ScaleWidth(29))];
self.timeDownView.delegate = self;
[self.bgView addSubview:self.timeDownView];
self.giftImageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.bgView.width-ScaleWidth(118))/2, self.timeDownView.bottom+11, ScaleWidth(118), ScaleWidth(118))];
@@ -325,6 +326,9 @@
}
}
}
-(void)timeDownDidFinished{
[self hide];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
@@ -624,10 +628,10 @@
NSString *time = [NSString stringWithFormat:@"%02ld%02ld",min,second];
if (time.length == 4) {
self.timeLabel1.text = [time substringWithRange:NSMakeRange(0, 1)];
self.timeLabel2.text = [time substringWithRange:NSMakeRange(1, 1)];
self.timeLabel3.text = [time substringWithRange:NSMakeRange(2, 1)];
self.timeLabel4.text = [time substringWithRange:NSMakeRange(3, 1)];
weakSelf.timeLabel1.text = [time substringWithRange:NSMakeRange(0, 1)];
weakSelf.timeLabel2.text = [time substringWithRange:NSMakeRange(1, 1)];
weakSelf.timeLabel3.text = [time substringWithRange:NSMakeRange(2, 1)];
weakSelf.timeLabel4.text = [time substringWithRange:NSMakeRange(3, 1)];
}
if (weakSelf.startTime<=0) {
[weakSelf stopTimer];
@@ -635,6 +639,9 @@
weakSelf.timeLabel2.text = @"0";
weakSelf.timeLabel3.text = @"0";
weakSelf.timeLabel4.text = @"0";
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(timeDownDidFinished)]) {
[weakSelf.delegate timeDownDidFinished];
}
}
});
}];

View File

@@ -36,7 +36,7 @@
self.scrollView.showsHorizontalScrollIndicator = NO;
self.scrollView.showsVerticalScrollIndicator = NO;
self.scrollView.scrollEnabled = YES;
self.scrollView.hidden = YES;
// self.scrollView.hidden = YES;
self.scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
[self addSubview:self.scrollView];
_itemSpace = 25;
@@ -76,7 +76,7 @@
}
-(void)startLotteryAnimation{
self.scrollView.hidden = NO;
// self.scrollView.hidden = NO;
[self.scrollView setContentOffset:CGPointZero animated:NO];
MJWeakSelf
[UIView animateWithDuration:6 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{