最后调整

This commit is contained in:
启星
2025-09-15 18:20:22 +08:00
parent 35709d4e8e
commit a3a7bfdf22
31 changed files with 707 additions and 366 deletions

View File

@@ -107,6 +107,11 @@ static NSInteger toSlowCount = 4;
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(663))];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
//
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(handlePanGesture:)];
[self.bgView addGestureRecognizer:panGesture];
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"active_sky_raize_bg"]];
self.bgImageView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(663));
@@ -266,7 +271,43 @@ static NSInteger toSlowCount = 4;
self.centerView.activityType = QXActivityTypeSky;
[self.bgView addSubview:self.centerView];
}
- (void)handlePanGesture:(UIPanGestureRecognizer *)gesture {
static CGPoint originalCenter;
if (gesture.state == UIGestureRecognizerStateBegan) {
//
originalCenter = gesture.view.center;
}else if (gesture.state == UIGestureRecognizerStateChanged) {
//
CGPoint translation = [gesture translationInView:self];
//
if (translation.y > 0) {
gesture.view.center = CGPointMake(originalCenter.x, originalCenter.y + translation.y);
// //
// CGFloat progress = translation.y / (self.view.bounds.size.height / 2);
// gesture.view.alpha = 1.0 - MIN(progress, 0.8);
}
}
else if (gesture.state == UIGestureRecognizerStateEnded ||
gesture.state == UIGestureRecognizerStateCancelled) {
CGPoint translation = [gesture translationInView:self];
CGPoint velocity = [gesture velocityInView:self];
//
BOOL shouldDismiss = translation.y > self.bgView.height/2.0 || velocity.y > 1000;
if (shouldDismiss) {
[self hide];
} else {
//
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(663);
}];
}
}
}
-(void)getMyWallet{
MJWeakSelf
[[QXRequset shareInstance] getWithUrl:QXWallet parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@""} needCache:NO success:^(id responseObject) {

View File

@@ -108,6 +108,11 @@ static NSInteger toSlowCount = 4;
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(663))];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
//
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(handlePanGesture:)];
[self.bgView addGestureRecognizer:panGesture];
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"active_age_castle_bg"]];
self.bgImageView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(663));
@@ -299,7 +304,43 @@ static NSInteger toSlowCount = 4;
[self.bgView addSubview:self.centerView];
}
- (void)handlePanGesture:(UIPanGestureRecognizer *)gesture {
static CGPoint originalCenter;
if (gesture.state == UIGestureRecognizerStateBegan) {
//
originalCenter = gesture.view.center;
}else if (gesture.state == UIGestureRecognizerStateChanged) {
//
CGPoint translation = [gesture translationInView:self];
//
if (translation.y > 0) {
gesture.view.center = CGPointMake(originalCenter.x, originalCenter.y + translation.y);
// //
// CGFloat progress = translation.y / (self.view.bounds.size.height / 2);
// gesture.view.alpha = 1.0 - MIN(progress, 0.8);
}
}
else if (gesture.state == UIGestureRecognizerStateEnded ||
gesture.state == UIGestureRecognizerStateCancelled) {
CGPoint translation = [gesture translationInView:self];
CGPoint velocity = [gesture velocityInView:self];
//
BOOL shouldDismiss = translation.y > self.bgView.height/2.0 || velocity.y > 1000;
if (shouldDismiss) {
[self hide];
} else {
//
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(663);
}];
}
}
}
-(void)getMyWallet{
MJWeakSelf
[[QXRequset shareInstance] getWithUrl:QXWallet parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@""} needCache:NO success:^(id responseObject) {

View File

@@ -9,7 +9,14 @@
#import "QXTimer.h"
#import "GKCycleScrollView.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger) {
/// 抽一次
QXMeetDrawBtnTypeOne = 1,
/// 抽10次
QXMeetDrawBtnTypeTen = 10,
/// 抽100次
QXMeetDrawBtnTypeHundred = 100,
}QXMeetDrawBtnType;
@interface QXMeetActivityView : UIView
-(void)showInView:(UIView *)view;
@property (nonatomic,strong)NSString *roomId;
@@ -43,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *giftCoin;
@property (nonatomic,assign)BOOL isDisable;
@property (nonatomic,assign)QXSkyDrawBtnType btnType;
@property (nonatomic,assign)QXMeetDrawBtnType btnType;
@end

View File

@@ -101,7 +101,11 @@
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(663))];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
//
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(handlePanGesture:)];
[self.bgView addGestureRecognizer:panGesture];
// NSString *path = [[NSBundle mainBundle] pathForResource:@"ac_meet_big_bg@2x" ofType:@"png"];
// UIImage *bgImage = [UIImage imageWithContentsOfFile:path];
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_big_bg"]];
@@ -223,21 +227,21 @@
CGFloat btnWidth = ScaleWidth(109);
CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4;
QXMeetDrawBtn *oneBtn = [[QXMeetDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))];
oneBtn.btnType = QXSkyDrawBtnTypeOne;
oneBtn.btnType = QXMeetDrawBtnTypeOne;
self.oneBtn = oneBtn;
self.oneBtn.hidden = YES;
[oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:oneBtn];
QXMeetDrawBtn *tenBtn = [[QXMeetDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
tenBtn.btnType = QXSkyDrawBtnTypeTen;
tenBtn.btnType = QXMeetDrawBtnTypeTen;
self.tenBtn = tenBtn;
self.tenBtn.hidden = YES;
[tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:tenBtn];
QXMeetDrawBtn *hundredBtn = [[QXMeetDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
hundredBtn.btnType = QXSkyDrawBtnTypeHundred;
hundredBtn.btnType = QXMeetDrawBtnTypeHundred;
self.hundredBtn = hundredBtn;
self.hundredBtn.hidden = YES;
[hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -284,6 +288,43 @@
self.drawGiftCenterBgImageView.frame = CGRectMake((self.bgView.width-ScaleWidth(105))/2, self.cycleScrollView.top+25, ScaleWidth(105), ScaleWidth(105));
[self.bgView addSubview:self.drawGiftCenterBgImageView];
}
- (void)handlePanGesture:(UIPanGestureRecognizer *)gesture {
static CGPoint originalCenter;
if (gesture.state == UIGestureRecognizerStateBegan) {
//
originalCenter = gesture.view.center;
}else if (gesture.state == UIGestureRecognizerStateChanged) {
//
CGPoint translation = [gesture translationInView:self];
//
if (translation.y > 0) {
gesture.view.center = CGPointMake(originalCenter.x, originalCenter.y + translation.y);
// //
// CGFloat progress = translation.y / (self.view.bounds.size.height / 2);
// gesture.view.alpha = 1.0 - MIN(progress, 0.8);
}
}
else if (gesture.state == UIGestureRecognizerStateEnded ||
gesture.state == UIGestureRecognizerStateCancelled) {
CGPoint translation = [gesture translationInView:self];
CGPoint velocity = [gesture velocityInView:self];
//
BOOL shouldDismiss = translation.y > self.bgView.height/2.0 || velocity.y > 1000;
if (shouldDismiss) {
[self hide];
} else {
//
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(663);
}];
}
}
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
@@ -730,7 +771,7 @@
_isDisable = isDisable;
self.bgImageView.image = [UIImage imageNamed:isDisable?@"meet_touch_dis_bg":@"meet_touch_bg"];
}
-(void)setBtnType:(QXSkyDrawBtnType)btnType{
-(void)setBtnType:(QXMeetDrawBtnType)btnType{
// ///
// QXSkyDrawBtnTypeOne = 0,
// /// 10
@@ -739,19 +780,19 @@
// QXSkyDrawBtnTypeHundred ,
_btnType = btnType;
switch (btnType) {
case QXSkyDrawBtnTypeOne:
case QXMeetDrawBtnTypeOne:
{
self.titleLabel.text = @"抽一次";
[self.giftCoin setTitle:@"10币一次" forState:(UIControlStateNormal)];
}
break;
case QXSkyDrawBtnTypeTen:
case QXMeetDrawBtnTypeTen:
{
self.titleLabel.text = @"抽十次";
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
}
break;
case QXSkyDrawBtnTypeHundred:
case QXMeetDrawBtnTypeHundred:
{
self.titleLabel.text = @"抽百次";
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];

View File

@@ -114,6 +114,12 @@ static NSInteger toSlowCount = 4;
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
[self.bgView addSubview:self.bgImageView];
//
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(handlePanGesture:)];
[self.bgView addGestureRecognizer:panGesture];
self.poolBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, ScaleWidth(48), ScaleWidth(48), ScaleWidth(24))];
[self.poolBtn setBackgroundImage:[UIImage imageNamed:@"time_right_bg"] forState:(UIControlStateNormal)];
[self.poolBtn setTitle:@"奖池" forState:(UIControlStateNormal)];
@@ -299,7 +305,43 @@ static NSInteger toSlowCount = 4;
[self.bgView addSubview:self.centerView];
}
- (void)handlePanGesture:(UIPanGestureRecognizer *)gesture {
static CGPoint originalCenter;
if (gesture.state == UIGestureRecognizerStateBegan) {
//
originalCenter = gesture.view.center;
}else if (gesture.state == UIGestureRecognizerStateChanged) {
//
CGPoint translation = [gesture translationInView:self];
//
if (translation.y > 0) {
gesture.view.center = CGPointMake(originalCenter.x, originalCenter.y + translation.y);
// //
// CGFloat progress = translation.y / (self.view.bounds.size.height / 2);
// gesture.view.alpha = 1.0 - MIN(progress, 0.8);
}
}
else if (gesture.state == UIGestureRecognizerStateEnded ||
gesture.state == UIGestureRecognizerStateCancelled) {
CGPoint translation = [gesture translationInView:self];
CGPoint velocity = [gesture velocityInView:self];
//
BOOL shouldDismiss = translation.y > self.bgView.height/2.0 || velocity.y > 1000;
if (shouldDismiss) {
[self hide];
} else {
//
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(663);
}];
}
}
}
-(void)getMyWallet{
MJWeakSelf
[[QXRequset shareInstance] getWithUrl:QXWallet parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@""} needCache:NO success:^(id responseObject) {